4

I try to merge two different layers but they don't have the same geometry, as i said one layer is Point and the other Line.

Is it possible to merging them in one layer?

Taras
  • 32,823
  • 4
  • 66
  • 137
Ala9
  • 41
  • 3
  • 1
    Do you want to store data with different geometry in one file or have the data displayed in QGIS as one layer? – Comrade Che Nov 09 '21 at 09:36
  • I want to displayed them as one layer in qgis ? – Ala9 Nov 09 '21 at 09:40
  • Do layers have exactly same attributes (same names, same data types)? – user30184 Nov 09 '21 at 09:52
  • they have different atributes – Ala9 Nov 09 '21 at 10:19
  • 1
    One layer has one fixed set of attributes. Do want that the combined layer will have attributes from both layers (a.attr1, a.attr2, a.attr3, b.attr1, b.attr2, b.attr3...). Naturally half of the attributes would be NULL then. – user30184 Nov 09 '21 at 10:46
  • Based on what you intend to do, a workaround would be creating a (very small) buffer around points as well as lines - then both (technically) will be polygons, whereas the "look and feel" still is more or less of "point" and "line". But this really is "quick and dirty". – Babel Nov 09 '21 at 11:08

1 Answers1

4

No, because "QGIS does not support GeometryCollection as a valid geometry type."

You can not merge layers with "Merge vector layers", but you can package them with "Package layers".

As a workaround, you may try to create a GeoJSON file with mixed geometries in it.


References:

Taras
  • 32,823
  • 4
  • 66
  • 137