Feature request #11635

ogr2ogr to merge several shapefiles in a folder

Added by Filipe Dias over 2 years ago. Updated over 2 years ago.

Status:Open Start Date:11/13/2014
Priority:Normal Due date:
Assigned to:Giovanni Manghi % Done:


Target version:Future Release - Nice to have
Platform: Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:


ogr2ogr can be used to merge several shapefiles. It would be useful to have an ogr2ogr based tool that merges several shapefiles stored in a folder. Here's an example code written by Darren Cope:

mkdir merged
for %f in (*.shp) do (
if not exist merged\merged.shp (
ogr2ogr -f “esri shapefile” merged\merged.shp %f) else (
ogr2ogr -f “esri shapefile” -update -append merged\merged.shp %f -nln Merged )

Source: http://darrencope.com/2010/05/07/merge-a-directory-of-shapefiles-using-ogr/


Updated by Alexander Bruy over 2 years ago

See also #7208 where more flexible Python code available

Also available in: Atom