1.0.1 • Published 9 years ago

turf-remove v1.0.1

Weekly downloads
1,423
License
MIT
Repository
github
Last release
9 years ago

turf-remove

build status

turf remove module

turf.remove(features, property, value)

Takes a FeatureCollection, a property, and a value and returns a FeatureCollection with features matching that property-value pair removed.

Parameters

parametertypedescription
featuresFeatureCollectiona FeatureCollection of any type
propertyStringthe property to filter
valueStringthe value to filter

Example

var points = turf.featurecollection([
 turf.point([-0.235004, 5.551918], {'marker-color': '#00f'}),
 turf.point([-0.209598, 5.56439], {'marker-color': '#f00'}),
 turf.point([-0.197753, 5.556018], {'marker-color': '#00f'}),
 turf.point([-0.217323, 5.549526], {'marker-color': '#000'}),
 turf.point([-0.211315, 5.543887], {'marker-color': '#0f0'}),
 turf.point([-0.202217, 5.547134], {'marker-color': '#00f'}),
 turf.point([-0.231227, 5.56644], {'marker-color': '#0f0'})
]);

//=points

var filtered = turf.remove(points, 'marker-color', '#00f');

//=filtered

Installation

Requires nodejs.

$ npm install turf-remove

Tests

$ npm test