Socket
Socket
Sign inDemoInstall

wkx

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wkx

A WKT/WKB/EWKT/EWKB/TWKB/GeoJSON parser and serializer


Version published
Weekly downloads
1.9M
decreased by-16.74%
Maintainers
1
Weekly downloads
 
Created

What is wkx?

The wkx npm package provides tools to parse and serialize Well-Known Text (WKT) and Well-Known Binary (WKB) formats, commonly used for representing geometric objects in Geographic Information Systems (GIS). It supports conversion between these formats and GeoJSON, making it useful for applications involving geospatial data manipulations.

What are wkx's main functionalities?

Parsing WKT to Geometry

This feature allows the parsing of Well-Known Text (WKT) into a Geometry object, which can then be converted to other formats like GeoJSON.

const wkx = require('wkx');
const wkt = 'POINT (30 10)';
const geometry = wkx.Geometry.parse(wkt);
console.log(geometry.toGeoJSON());

Serializing Geometry to WKT

This feature enables the serialization of Geometry objects (e.g., Point) into the Well-Known Text (WKT) format.

const wkx = require('wkx');
const point = new wkx.Point(30, 10);
const wkt = point.toWkt();
console.log(wkt);

Parsing WKB to Geometry

This feature allows the parsing of Well-Known Binary (WKB) into a Geometry object, which can then be converted to formats like GeoJSON.

const wkx = require('wkx');
const wkbBuffer = Buffer.from('0101000000000000000000F03F000000000000F03F', 'hex');
const geometry = wkx.Geometry.parse(wkbBuffer);
console.log(geometry.toGeoJSON());

Serializing Geometry to WKB

This feature enables the serialization of Geometry objects into the Well-Known Binary (WKB) format.

const wkx = require('wkx');
const point = new wkx.Point(30, 10);
const wkb = point.toWkb();
console.log(wkb.toString('hex'));

Other packages similar to wkx

Keywords

FAQs

Package last updated on 07 Jun 2019

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