Skip to content

Instantly share code, notes, and snippets.

@mikejs
Created February 15, 2011 15:50
Show Gist options
  • Save mikejs/827680 to your computer and use it in GitHub Desktop.
Save mikejs/827680 to your computer and use it in GitHub Desktop.
merge a bunch of shapefiles
#!/bin/bash
mkdir merged
for f in "$@"
do
if [ -f merged/merged.shp ]
then
ogr2ogr -f "esri shapefile" -update -append merged/merged.shp $f -nln Merged
else
ogr2ogr -f "esri shapefile" merged/merged.shp $f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment