Created
August 27, 2014 15:51
-
-
Save jgcasta/685ca7d55638545f18a8 to your computer and use it in GitHub Desktop.
Shell script to merge a list of SHP files from a set of directories
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 | |
ogr2ogr -a_srs EPSG:4326 out.shp | |
directories=$(find . -type d) | |
for directory in $directories | |
do | |
files=$(find $directory -name '*.shp') | |
for file in $files | |
do | |
echo $file | |
ogr2ogr -append -update out.shp $file -f "Esri Shapefile" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment