Skip to content

Instantly share code, notes, and snippets.

@andrewharvey
Created May 4, 2018 12:11
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 andrewharvey/5235ede6b7a019c5cc0fa391a3149e7b to your computer and use it in GitHub Desktop.
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
#!/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