Feature request #7208

replace the "merge shapefiles" code with new more efficient one (python code available)

Added by Giovanni Manghi about 11 years ago. Updated over 5 years ago.

Pull Request or Patch supplied:No Resolution:wontfix
Easy fix?:No Copied to github as #:16248


The "merge shapefiles" tool is very inefficient, when applied to hundreds/thousands of shapes the progress bar barely moves for many hours on a very powerful machine.

I discovered this python code


that does the task in a matter of seconds even for many GB worth of shapefiles.

Its speed is equal, if not faster to an ogr2ogr script

DATA=`find . -name '*.shp'`
ogr2ogr -a_srs EPSG:4326 merge.shp
for i in $DATA
ogr2ogr -append -update merge.shp $i -f "Esri Shapefile"

shapemerger.py Magnifier (16.8 KB) Giovanni Manghi, 2013-04-11 05:59 AM

Related issues

Related to QGIS Application - Feature request #9652: merge shapefiles: add option to get the result directly i... Closed 2014-02-25
Related to QGIS Application - Feature request #10691: "Merge shapefiles to one": add the options available in t... Closed 2014-06-24


#2 Updated by Antonio Locandro about 10 years ago

Any updates on this?

#3 Updated by Giovanni Manghi about 10 years ago

  • Target version set to Future Release - Nice to have

Antonio Locandro wrote:

Any updates on this?


#4 Updated by Giovanni Manghi about 7 years ago

  • Category changed from 44 to Processing/QGIS

#5 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No

#6 Updated by Nyall Dawson over 5 years ago

  • Resolution set to wontfix
  • Description updated (diff)
  • Status changed from Open to Closed

Processing doesn't work on shapefiles alone, so the code provided cannot be used as a replacement. In any case I suspect this issue is fixed in 3.0.

Also available in: Atom PDF