Created
October 17, 2013 15:21
-
-
Save whyvez/7026873 to your computer and use it in GitHub Desktop.
Downloads all GeoJSON file recursively from an S3 bucket and appends into one master shp file.
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 | |
# usage: s3geojson2shp.sh my.bucket.com | |
# retreive all files from the s3 bucket | |
aws s3 cp --recursive s3://$1 . | |
# append .geojson to all files and append into master shp file | |
for file in *; | |
do | |
test ${file%.*} = $file && mv $file $file.geojson | |
ogr2ogr -f 'ESRI Shapefile' -update -append merged $file.geojson | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment