geojson-extract-geometries
Extract geometries from geojson for given basic geometry type.
installation
npm install geojson-extract-geometries
usage
var extract = require('geojson-extract-geometries')
var geometries = extract(geojson, type)
type is basic GeoJSON geometry type Point | LineString | Polygon
default is Point
example
var features = "type": "FeatureCollection" "features": "type": "Feature" "geometry": "type": "Point" "coordinates": 1020 05 "properties": "prop0": "value0" "type": "Feature" "geometry": "type": "LineString" "coordinates": 1020 00 1030 10 1040 00 1050 10 "properties": "prop0": "value0" "prop1": 00 "type": "Feature" "geometry": "type": "Polygon" "coordinates": 1000 00 1010 00 1010 10 1000 10 1000 00 "properties": "prop0": "value0" "prop1": "this": "that" var extract = var geometries = // geometries variable value is// [// { // "type": "LineString",// "coordinates": [// [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]// ]// }// ]
developing
Once you run
npm isntall
then for running test
npm run test
to create build
npm run build
license
This project is licensed under the terms of the MIT license.