Skip to content

jjrv/cgeo-wkb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

WKB import/export for cgeo types

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published