mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added filter definition.
This commit is contained in:
@@ -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
|
||||
//////////////////////////////////////////////////////////////////////////;
|
||||
|
||||
Vendored
+9
@@ -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
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user