Feature request #7208

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

Added by Giovanni Manghi almost 12 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/QGIS
Pull Request or Patch supplied:No Resolution:wontfix
Easy fix?:No Copied to github as #:16248

Description

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

http://furiousgis.blogspot.it/2012/05/python-shapefile-merger-utility.html

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


#!/bin/bash/
DATA=`find . -name '*.shp'`
ogr2ogr -a_srs EPSG:4326 merge.shp
for i in $DATA
do
ogr2ogr -append -update merge.shp $i -f "Esri Shapefile"
done

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

History

#2 Updated by Antonio Locandro almost 11 years ago

Any updates on this?

#3 Updated by Giovanni Manghi almost 11 years ago

  • Target version set to Future Release - Nice to have

Antonio Locandro wrote:

Any updates on this?

nope.

#4 Updated by Giovanni Manghi almost 8 years ago

  • Category changed from 44 to Processing/QGIS

#5 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

#6 Updated by Nyall Dawson over 6 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