cgeo-wkb
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

cgeo-wkb

npm version

Adds WKB export support to cgeo.

This augments all geometry types (in a TypeScript-friendly way) with a toWKB method returning a Uint8Array. The method takes an optional configuration object with the member:

  • endian, default is Endian.little. See cbin.

Additionally, the static method Geometry.fromWKB takes a Uint8Array and returns the appropriate geometry object.

Usage

import * as cgeo from 'cgeo';
import 'cgeo-wkb';
 
const point = new cgeo.Point(12, 34);
 
console.log(Buffer.from(point.toWKB()).toString('hex'));

License

The MIT License

Copyright (c) 2017 BusFaster Ltd

Readme

Keywords

Package Sidebar

Install

npm i cgeo-wkb

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • jjrv