Created
May 4, 2018 12:11
-
-
Save andrewharvey/5235ede6b7a019c5cc0fa391a3149e7b to your computer and use it in GitHub Desktop.
Hacky low memory geojson merge for when geojson-merge -s just isn't working
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/sh | |
echo '{"type": "FeatureColletion", "features": [' > head.json | |
echo ']}' > foot.json | |
echo ',' > comma.txt | |
for f in *.geojson.gz ; do cat $f | gunzip | tail -n+2 | head -n -1 | cat - comma.txt > tmp/$f ; done | |
cat head.json tmp/* | head -c -4 | cat - foot.json > merged.geojson |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment