Skip to content

Takes a feature collection and returns N random features as a feature collection.

License

Notifications You must be signed in to change notification settings

turf-junkyard/turf-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

turf-sample

build status

turf sample module

turf.sample(features, n)

Takes a FeatureCollection and returns a FeatureCollection with given number of Feature|features at random.

Parameters

parameter type description
features FeatureCollection set of input features
n Number number of features to select

Example

var points = turf.random('points', 1000);

//=points

var sample = turf.sample(points, 10);

//=sample

Returns FeatureCollection, a FeatureCollection with n features

Installation

Requires nodejs.

$ npm install turf-sample

Tests

$ npm test

About

Takes a feature collection and returns N random features as a feature collection.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •