Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twkb

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twkb

TWKB format reader

  • 0.2.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

twkb

Build Status

This library allows to decode TWKB.

WARNING: this is a preview and may change without any notice

Usage

twkb.toGeoJSON(buffer)

Building

npm install
npm run build

Example

this is a simple example using leaflet

function get(url, callback) {
  var oReq = new XMLHttpRequest();
  oReq.open("GET", url, true);
  oReq.responseType = "arraybuffer";

  oReq.onload = function (oEvent) {
    callback(oReq.response);
  };

  oReq.send(null);
}

var map = L.map('map').setView([40.505, -3.09], 5);

get('file.twkb', function(data) {
    var g = new twkb.toGeoJSON(new Uint8Array(data))
    L.geoJson({ features: g, type: "FeatureSet"}).addTo(map)
})

API

twkb

twkb.toGeoJSON(buffer)

Returns valid GeoJSON for the features

License

see LICENSE file

FAQs

Package last updated on 14 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc