turf sample module
Takes a FeatureCollection and returns a FeatureCollection with given number of Feature|features at random.
parameter | type | description |
---|---|---|
features |
FeatureCollection | set of input features |
n |
Number | number of features to select |
var points = turf.random('points', 1000);
//=points
var sample = turf.sample(points, 10);
//=sample
Returns FeatureCollection
, a FeatureCollection with n
features
Requires nodejs.
$ npm install turf-sample
$ npm test