Skip to content

Instantly share code, notes, and snippets.

@om-henners
Last active October 7, 2019 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save om-henners/20487f06816c74f2915ee4bdd679aff5 to your computer and use it in GitHub Desktop.
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
.properties as $propertiess | {
"type": "FeatureCollection",
"features": [
(.geometries[] |
{
"type": "Feature",
"properties": (.properties + $propertiess),
"geometry": del(.properties)
}
)
]
}
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