turf-filter
turf filter module
Last updated 6 years ago by morganherlocker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-filter 
SYNC missed versions from official npm registry.

turf-filter

build status

turf filter module

turf.filter(features, key, value)

Takes a FeatureCollection and filters it by a given property and value

Parameters

parameter type description
features FeatureCollection input FeatureCollection of any type
key String the property on which to filter
value String the value of that property on which to filter

Example

var features = turf.featurecollection([
 turf.point([-72.581777, 44.260875], {species: 'oak'}),
 turf.point([-72.570018, 44.260691], {species: 'birch'}),
 turf.point([-72.576284, 44.257925], {species: 'oak'}),
 turf.point([-72.56916, 44.254605], {species: 'redwood'}),
 turf.point([-72.581691, 44.24858], {species: 'maple'}),
 turf.point([-72.583837, 44.255773], {species: 'oak'})
]);

var key = 'species';
var value = 'oak';

var filtered = turf.filter(features, key, value);

//=features

//=filtered

Installation

Requires nodejs.

$ npm install turf-filter

Tests

$ npm test

Current Tags

  • 1.0.1                                ...           latest (6 years ago)

5 Versions

  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (1)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |