nqm-geojson-tools

0.0.4 • Public • Published

nqm-geojson-tools.js

Nqm-GeoJSON-Tools is a JavaScript module for working with geojson data of NquiringMinds Ltd.

Installation

Install node.js, then:

npm install nqm-geojson-tools

usage

var geoDataInOut = require('nqm-geojson-bbox');
 
...........................................
 
// get the geojson points in a geojson polygon/multipolygon, also return the points out of this polygon
var pointsInOut = geoDataInOut.getPointsInPolygon(geoPolygonData, geoPointsDataArray);
var pointsIn = pointsInOut[0];
var pointsOut = pointsInOut[1];
 
...........................................
 
// get the geojson points in a circle, also return the points out of this circle
var pointsInOut = geoDataInOut.getPointsInCircle(geoCentrePoint, radius, geoPointsDataArray); // radius--km
var pointsIn = pointsInOut[0];
var pointsOut = pointsInOut[1];
 
...........................................
 
// get the distance between two geojson points
var distance = geoDataInOut.getDistance(geoPoint1, geoPoint2); // km
 
...........................................
 
// get boundary box of a geojson object or an array with geojson objects
var bbox = geoDataInOut.getBBox(geoData);
...........................................
 
// get the centre of a geojson object or an array with geojson objects, based on the boundary box
var centre = geoDataInOut.getCentre(geoData);
 
...........................................
 
// save json data to outPath
geoDataInOut.jsonSave(jsonData, outPath);

Readme

Keywords

Package Sidebar

Install

npm i nqm-geojson-tools

Weekly Downloads

2

Version

0.0.4

License

ISC

Last publish

Collaborators

  • gleng