geojson-filter
Return a new GeoJson only whit features which pass the filter, this library is a tiny wrapper around feature-filter-geojson.
Go to feature-filter-geojson for complete doc about filter array possibilities.
usage
const gjfilter = ; const filter = "==" "prop0" "value0"; let geojson = "type": "FeatureCollection" "features": "type": "Feature" "geometry": "type": "Point" "coordinates": 1020 05 "properties": "prop0": "value0" "type": "Feature" "geometry": "type": "LineString" "coordinates": 1020 00 1030 10 1040 00 1050 10 "properties": "prop0": "value0" "prop1": 00 "type": "Feature" "geometry": "type": "Polygon" "coordinates": 1000 00 1010 00 1010 10 1000 10 1000 00 "properties": "prop0": "value1" "prop1": "this": "that" ; console;
The output is:
"type": "FeatureCollection" "features": "type": "Feature" "geometry": "type": "Point" "coordinates": 1020 05 "properties": "prop0": "value0" "type": "Feature" "geometry": "type": "LineString" "coordinates": 1020 00 1030 10 1040 00 1050 10 "properties": "prop0": "value0" "prop1": 00