Last active
March 3, 2020 10:32
-
-
Save missinglink/342ea4bd4c6f735a9e3c5af137d10b73 to your computer and use it in GitHub Desktop.
Convert a stream of geojson features to a feature collection
This file contains 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
#!/bin/bash | |
featureCollectionSandwich() { | |
echo '{ "type": "FeatureCollection", "features":' | |
cat - | jq -s . | |
echo '}' | |
} |
This file contains 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
source featureCollectionSandwich.sh | |
sqlite3 /data/wof/whosonfirst-data-latest.db 'SELECT body FROM geojson WHERE id<2' | featureCollectionSandwich > out.geojson |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment