turf-count
turf count module
turf.count(polygons, points, countField)
Takes a FeatureCollection of Point features and a FeatureCollection of Polygon features and calculates the number of points that fall within the set of polygons.
Parameters
parameter | type | description |
---|---|---|
polygons |
FeatureCollection | a FeatureCollection of Polygon features |
points |
FeatureCollection | a FeatureCollection of Point features |
countField |
String | a field to append to the attributes of the Polygon features representing Point counts |
Example
var polygons = turf;var points = turf; var counted = turf; var result = turf; //=result
Installation
Requires nodejs.
$ npm install turf-count
Tests
$ npm test