Last active
October 7, 2019 01:52
-
-
Save om-henners/20487f06816c74f2915ee4bdd679aff5 to your computer and use it in GitHub Desktop.
jq https://stedolan.github.io/jq/ filter to transform GeoJSON Geometry Collection into Feature Collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.properties as $propertiess | { | |
"type": "FeatureCollection", | |
"features": [ | |
(.geometries[] | | |
{ | |
"type": "Feature", | |
"properties": (.properties + $propertiess), | |
"geometry": del(.properties) | |
} | |
) | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat geom_collection.json | jq -f filter.jq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment