0.0.1 • Published 6 years ago

cgeo-wkb v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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