Feature request #11635

ogr2ogr to merge several shapefiles in a folder

Added by Filipe Dias almost 3 years ago. Updated 6 months ago.

Status:Open
Priority:Normal
Assignee:Giovanni Manghi
Category:Processing/GDAL
Pull Request or Patch supplied:No Resolution:
Easy fix?:No

Description

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/

History

#1 Updated by Alexander Bruy almost 3 years ago

See also #7208 where more flexible Python code available

#2 Updated by Giovanni Manghi 6 months ago

  • Easy fix? set to No

Also available in: Atom PDF