Added filter definition.

This commit is contained in:
gcroteau
2015-11-24 23:44:45 -05:00
parent 4d5969f17c
commit b5b7ec2ce0
2 changed files with 14 additions and 0 deletions
+5
View File
@@ -347,6 +347,11 @@ var polygon = turf.polygon([[
// Tests Data
//////////////////////////////////////////////////////////////////////////
// -- Test filter --
var key = "species";
var value = "oak";
var filtered = turf.filter(features, key, value);
//////////////////////////////////////////////////////////////////////////
// Tests Interpolation
//////////////////////////////////////////////////////////////////////////;
+9
View File
@@ -296,6 +296,15 @@ declare module turf {
// Data
//////////////////////////////////////////////////////
/**
* Takes a FeatureCollection and filters it by a given property and value.
* @param features Input features
* @param key The property on which to filter
* @param value The value of that property on which to filter
* @returns A filtered collection with only features that match input key and value
*/
function filter(features: GeoJSON.FeatureCollection, key: string, value: string): GeoJSON.FeatureCollection;
//////////////////////////////////////////////////////
// Interpolation
//////////////////////////////////////////////////////