turf-clip
Clip one featurecollection by another.
turf.clip(clipping_geojson, input_geojson)
Takes a clipping_geojson to clip the input_geojson.
Parameters
parameter | type | description |
---|---|---|
clipping_geojson |
FeatureCollection | Clip FeatureCollection |
input_geojson |
FeatureCollection | FeatureCollection to be clipped |
Example
var clipping_geojson= "type": "FeatureCollection" "features": "type": "Feature" "properties": {} "geometry": "type": "Polygon" "coordinates": 11085205078124999 3174685416292141 11085205078124999 3504798673426734 11744384765625 3504798673426734 11744384765625 3174685416292141 11085205078124999 3174685416292141 ;var input_geojson= "type": "FeatureCollection" "features": "type": "Feature" "properties": {} "geometry": "type": "Polygon" "coordinates": 113367919921875 3536217605914681 11197265625 30694611546632277 11612548828124999 3093050081760779 11493896484374999 3569299463209881 113367919921875 3536217605914681 ;var result = turfclipclipping_geojson input_geojson; //=result
Returns FeatureCollection
,
Installation
Requires nodejs.
$ npm install turf-clip
Tests
$ npm run test