cgeo-wkb
v0.0.1
Published
WKB import/export for cgeo types
Downloads
3
Readme
cgeo-wkb
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 isEndian.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
Copyright (c) 2017 BusFaster Ltd