How to merge shapefiles?

Merging more than two shapefiles in QGIS

  • I want to merge 9 shapefiles (all polygons) into one file. The problem is, when I try to merge more than two files at once, I seem to loose attributes on the way? Is there any other way of merging shapefiles than using the 'Merge shapefiles to one'-tool? In this case it's only nine files, so it's possible to merge whem 2 and 2, but I want to do the same thing with other files as well, and then merge about 20 files to one. I'm using QGIS 2.0.1. Thanks! EDIT: I have data of 4 different kinds of natural reserves (polygons). Each reserve has data seperated into three different shapefiles, where each shapefile is cooected to a powerline. The three powerlines are parallell at first and then turn in different directions. Each kind of natural reserve contains slightly different information, but they all contain the columns 'Powerline' (powerline identity) and 'Type' (type of natural reserve). I want my output to contains all of the polygons and all attribute data. What happened was that information like 'Powerline' was lost when I tried to merge all files at once.

  • Answer:

    This seems like a task for scripting more than a graphical environment like QGIS. My first thought was ogr and the first google hit for 'ogr2ogr merge shapefiles' is http://gis-programming.com/?p=194, which seems to address your question. Haven't tried this myself, but should work. Good luck!

SoS at Geographic Information Systems Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.