Skip to content

GeoPlegma/GeoPlegma-js

Repository files navigation

Introduction

JavaScript package for GeoPlegma. At this point, it runs only DGGRID.

Get Started

Install the library.

npm install GeoPlegma-js

or

yarn add GeoPlegma-js

or

pnpm install GeoPlegma-js

Example:

import { Dggrs } from "geoplegma-js";
const g = new Dggrs("isea3h");
const rl = 3;
const bbox = [
  [-10.0, -10.0],
  [10.0, 10.0],
];
const a = g.zonesFromBbox(rl, bbox);

console.log("from bbox: " + a.map((v) => v.id));
// from bbox: 307fffffffffffff,30bfffffffffffff,31bfffffffffffff,323fffffffffffff,327fffffffffffff,32bfffffffffffff,3a7fffffffffffff

Development

  • Install dependencies:
npm install
  • Get the native binding files:
npm run build-native

This will: Build the .node files from GeoPlegma/gp-bindings/js. Copy them into GeoPlegma-js/native/. Let your JS code require('./native/something.node') without committing them.

  • Run the unit tests:
npm run test
  • Build the library:
npm run build

The build script will build a new folder dist with the bundled files inside, and copy the index.node and index.d.ts files into that same folder. This folder will be used in the npm library as the source code files.

NOTE: Eventually a github job will be added for this statement workflow.

About

The JavaScript library for GeoPlegma.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENCE-APACHE.txt
MIT
LICENCE-MIT.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published