Usage
Filter by property or geometry
- It filters features by given property or geometry and it will generate a new GeoJSON files with the filtered features.
COMMAND | REQUIRED | DESCRIPTION |
---|---|---|
--geojson_input | yes | Path to GeoJSON to process. |
--mode_filter | yes | Filtering mode: - by_properties: filter by given properties. - by_properties_strict: features must have all given properties to filter. - by_geometry: filter by given geometry type. |
--props | yes | Property/Geometry to filter. In case of properties, they can be: key=value or key=*. |
--mode_output | no | Output mode: - merged: all features in one file - by_props: features in each file according filtered properties. - by_geometry: features in each file according the filtered geometries. Defaul value: merged. |
--geojson_output | yes | Path to GeoJSON output. |
Return:
GeoJSON file - Different GeoJSON files according the output mode that contains the filtered features.
Command line:
docker run --rm -v ${PWD}:/mnt/data developmentseed/geokit:python.latest geo \
fc_filter \
--geojson_input=<INPUT_GEOJSON> \
--mode_filter=by_properties \
--props=key1=value1 \
--props=key2=value2 \
--mode_output=by_props \
--geojson_output=<OUTPUT_GEOJSON>
Use case:
- Filter by property: From a set of different features in a GeoJSON file, filter only buildings.
- Filter by geometry: From a set of different types of features in a GeoJSON file, filter only LineString type.