JSPM

cgeo-wkb

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q22361F
  • License MIT

WKB import/export for cgeo types

Package Exports

  • cgeo-wkb

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cgeo-wkb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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