Comparing version
{ | ||
"name": "turf", | ||
"version": "0.0.64", | ||
"version": "0.0.65", | ||
"description": "a node.js library for performing geospatial operations with geojson", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,2 +49,3 @@ turf | ||
- combine | ||
- remove | ||
- distance | ||
@@ -77,3 +78,2 @@ - buffer | ||
- intersect | ||
- remove | ||
- union | ||
@@ -312,2 +312,18 @@ - erase | ||
**remove** | ||
Removes any features from a feature collection that match a property value. | ||
```javascript | ||
var t = require('turf') | ||
var trees = t.featurecollection([t.point(1,2, {species: 'oak'}), t.point(2,1, {species: 'dogwood'}), t.point(3,1, {species: 'maple'})]) | ||
t.remove(points, 'species', 'dogwood', function(err, result) { | ||
if(err) throw err | ||
console.log(result) | ||
}) | ||
``` | ||
**inside** | ||
@@ -314,0 +330,0 @@ |
@@ -1,8 +0,16 @@ | ||
var t = require('../lib/remove') | ||
var t = require('../index') | ||
, should = require('should'); | ||
describe('remove', function(){ | ||
xit('should ', function(done){ | ||
throw new Error('not implemented') | ||
done() | ||
it('should return 3', function(done){ | ||
var points = t.featurecollection([t.point(1,2, {team: 'Red Sox'}), t.point(2,1, {team: 'Yankees'}), t.point(3,1, {team: 'Nationals'}), t.point(2,2, {team: 'Yankees'}), t.point(2,3, {team: 'Red Sox'}), t.point(4,2, {team: 'Yankees'})]) | ||
t.remove(points, 'team', 'Yankees', function(err, newCol) { | ||
//throw new Error('not implemented') | ||
if(err) throw err | ||
//console.log(newCol.features[0].properties); | ||
console.log(newCol.features.length) | ||
newCol.features.length.should.equal(3) | ||
done() | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1033200
3.06%116
0.87%11874
0.25%594
2.77%