turf-sample
turf sample module
turf.sample(features, n)
Selects a given number of Feature|features from a FeatureCollection at random.
Parameters
parameter | type | description |
---|---|---|
features |
FeatureCollection | |
n |
number | number of features to select |
Example
// create a lot of points
var points = turf.random('points', 1000);
//=points
// sample just a few of them
var sample = turf.sample(points, 10);
//=sample
Installation
Requires nodejs.
$ npm install turf-sample
Tests
$ npm test