1 | var test = require('tape');
|
2 | var sample = require('./');
|
3 | var featureCollection = require('turf-helpers').featureCollection;
|
4 | var point = require('turf-helpers').point;
|
5 |
|
6 | test('remove', function(t){
|
7 | var points = featureCollection(
|
8 | [point([1,2], {team: 'Red Sox'}),
|
9 | point([2,1], {team: 'Yankees'}),
|
10 | point([3,1], {team: 'Nationals'}),
|
11 | point([2,2], {team: 'Yankees'}),
|
12 | point([2,3], {team: 'Red Sox'}),
|
13 | point([4,2], {team: 'Yankees'})]);
|
14 |
|
15 | newFC = sample(points, 4);
|
16 |
|
17 | t.equal(newFC.features.length, 4, 'should sample 4 features');
|
18 | t.end();
|
19 | });
|