2

I have four shapefiles. Each contains a linestring as shown in the image. Each shapefile is represented as its own layer in QGIS.

Four linestrings

I would like to union these linestrings into one polygon which describes the outline of all four shapes as shown in the following image I produced with Gimp. I could not dissolve the parts since they are spread on four layers.

Outline

I uploaded the shapefiles for you to try yourself. The archive contains the four separate shapes as well as the merged geometries (Pfinztal-Merged-4326.zip) I produced.

JJD
  • 1,511
  • 1
  • 17
  • 30
  • 1
    http://gis.stackexchange.com/questions/25061/how-to-merge-multiple-layers-to-one-layer-using-qgis then dissolve using your instructions. – Michael Stimson Feb 05 '15 at 23:03
  • @MichaelMiles-Stimson The MMQGIS plugin works good. However, non of the layers has a attribute column which has a common value for all nodes. Therefore, I cannot dissolve the shapes by such a column. – JJD Feb 05 '15 at 23:15
  • Does that really matter? if you just want them dissolved add a field and set them all the same. – Michael Stimson Feb 05 '15 at 23:35
  • @MichaelMiles-Stimson I already tried but could not find out how to apply the same value to hundreds of rows in the attribute editor (without manually copy/pasting them). – JJD Feb 05 '15 at 23:58
  • 2
    http://docs.qgis.org/1.8/en/docs/user_manual/working_with_vector/field_calculator.html right click on layer, open attribute table and use field calculator. – Michael Stimson Feb 06 '15 at 00:32
  • @MichaelMiles-Stimson, you should post the steps as an answer. Easier for the OP to understand, plus the method you describe should be a solution for this problem. – Joseph Feb 06 '15 at 10:18
  • @MichaelMiles-Stimson Yes, please convert your comments into a full answer. Your steps should work - I will try them in a few hours. – JJD Feb 06 '15 at 11:52
  • @MichaelMiles-Stimson I add a xxx column to each shapefile. All rows in this column have the same value for one shapefile. The values are 1, 2, 3, 4 for all shapefiles. I successfully merged the shapefiles using MMQGIS. The merged shapefile took over the different values assigned before. When I dissolve by the xxx column all inner lines stay. What am I doing wrong? – JJD Feb 07 '15 at 17:14
  • To dissolve the interior lines they must have the same value. All the values of xxx should be the same for a proper dissolve. Is there any reason why the lines need to have different attributes? I was under the impression that you just wanted to dissolve the lines; the tool is doing what it's supposed to do keeping lines of different attributes, where there is a common line the attributes need to be the same to eliminate one of the lines. If you need different attributes then apply them after dissolving. – Michael Stimson Feb 08 '15 at 21:12
  • @MichaelMiles-Stimson I am actually not interested in any of the attributes besides the geometry coordinates. – JJD Feb 09 '15 at 09:59
  • 1
    Set your XXX values all the same and dissolve, that should remove duplicate lines provided they are overlaid, if they are not perfect have a look at http://gis.stackexchange.com/questions/11004/removing-small-spaces-slivers-between-polygons to make the lines coalesce. – Michael Stimson Feb 09 '15 at 21:40
  • Strike. This time it worked. Important detail: The shapefiles cannot be loaded from a .zip file because the attributes table will not be writeable then. Further all linestrings of the outline must have an equal value in a temporary column - an the inner linestrings must have an odd value. - Michael, would you please sum up the steps in a full answer - then I am happy to grant you the answer flag. Thank you. – JJD Feb 10 '15 at 09:26

0 Answers0