Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Archive for the ‘OGR’ Category

OGR for merging shapefiles

Posted by smathermather on June 8, 2013

I upgraded to Ubuntu 12.10.  It’s nice, but it means I can no longer run QGIS 1.9 easily, so I’m limping along with 1.8, and without functional python extensions at that.

So, when I wanted to merge a directory of 60 some odd shapefiles, I turned to OGR.  GIS Programming at http://gis-programming.com/?p=194 shows how to do it on Windows.  Here’s the linux/BASH way:

for f in *.shp; do ogr2ogr -update -append merge.shp $f -f "ESRI Shapefile"; done;

Posted in OGR | Tagged: | Leave a Comment »