2

I would like to merge a few layers in QGIS. However, I can't do this. When I run the MMGIS option, then I am getting:

Merged input_layers must all be same type of geometry (MultiLineString != Polygon)

According to the MMQGIS author, all layers must be in the same geometry.

In this case, I set all the same geometries for my objects:

enter image description here

But it didn't solve my problem:

enter image description here

So I tried another way:

In the Vector - Data Management Tools - Merge Vector Layers I selected my layers. Unfortunately, I got sth like this:

enter image description here

According to this question:

Merge layers with different geometry

I used "Join attributes by location" option, although afterward, I got only 1 layer, even when I select "Create the separate features for joint..."

enter image description here

Should I use the GRASS as per below?

Error in merging two shapefiles of different geometry types

I would like to have all the layers in the picture below merged:

enter image description here

Or should I maybe do sth like this:

Merging layers into one- QGIS

UPDATE:

As per the advice below I tried the "Promote to the multipart" option.~ Unfortunately, it doesn't solve my query too, since this tool can promote only 1 layer:

enter image description here

In the effect I have only 1 layer "multipart", but how about other ones?

enter image description here

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Geographos
  • 4,087
  • 2
  • 27
  • 88
  • 1
    You could try using the Promote to multipart tool on all your layers before merging to ensure they have the same geometry type. – Joseph Jan 14 '20 at 10:28
  • Where can I find it? I just found the repository with no examples really:

    https://docs.qgis.org/3.4/es/docs/user_manual/processing_algs/qgis/vectorgeometry.html#promote-to-multipart

    – Geographos Jan 14 '20 at 10:41
  • 2
    From the Processing Toolbox. – Joseph Jan 14 '20 at 10:42
  • 1
    A yeah, here we go! Thank you! I haven't taken the processing toolbox into account at that moment. – Geographos Jan 14 '20 at 10:44
  • Since the "Promote to the multipart" options offer only 1 layer "promotion" I had to updated my query. – Geographos Jan 14 '20 at 11:06
  • 1
    What I meant was to use the Promote to multipart on all of the layers you are interested in. Then when you have all the outputs, run the merge tool. If you don't want to use the Promote to multipart each time for each layer, run it as a batch process by right-clicking it from the Processing Toolbox. – Joseph Jan 14 '20 at 11:18
  • I did it and I am still getting error: All layers must have same geometry type! Encountered a Line layer when expecting a Polygon layer. – Geographos Jan 14 '20 at 11:22
  • 2
    You can only merge multipart polygon shapefiles together, you can't mix with multipart lines or multipart points (if that is what you were trying to do?). – Joseph Jan 14 '20 at 11:25
  • So how about the lines then? Is it possible to do? – Geographos Jan 14 '20 at 11:39
  • 1
    If you want to store your shapefiles into a single file, consider the GeoPackage layer. This will let you store polygons, lines, points etc in a single file. – Joseph Jan 14 '20 at 11:46
  • I tried it. It would be helpful, but I can't import it straight to QGIS and save as a shapefile. – Geographos Jan 14 '20 at 15:23

0 Answers0