I have a catalog tree with a number of subfolders. In every folder there is point and polygon shapefiles. What I want to do is for every type of shapefile point and polygon to do a merge by type.

Is that possible to be done using python or anything else?

  • the merge tool under geoprocessing allows you to merge different feature classes (incl. shapefiles) of the same geometry type. You shouldn't need any python, just run it once for each type. – jbchurchill Sep 17 '15 at 14:38
  • what software are you using? – Maksim Sep 17 '15 at 15:14
  • I'm using Arcgis 10.2.2 – Dimitris Kasabalis Sep 18 '15 at 6:11
  • @jbchurchill I know what merge tool is doing but I want to do this task for a large number of files and thats the reason why I need it to be done with python – Dimitris Kasabalis Sep 18 '15 at 6:16

You can do this without Python or QGIS if you have GDAL/OGR installed:

ogr2ogr -update -append first.shp second.shp

This will add all the features in second.shp to first.shp (good idea to back up first.shp before running this).

You can write a script to run this command once for all the files you have in your directory.


I'd suggest to create a central folder with all shapefiles, then let QGIS do the merge by selecting the type: Vector> Data Management Tools> Merge Shapefiles to One

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.