3

QGIS 3.34.3 has a processing function "Multipart to singleparts". But what about the other way around? What is the easiest way to create a MultiPolygon from several polygons?

1
  • Also the "exact" opposite of "Multipart to singleparts" is actually "Promote to multipart" (which doesn't combine polygons, just make singlepolygons into multipolygons containing a single part) but I don't think that is what you meant.
    – Kalak
    Feb 16 at 8:49

1 Answer 1

4

"Collect geometries" processing algorithm is what you are looking for.

Takes a vector layer and collects its geometries into new multipart geometries.

One or more attributes can be specified to collect only geometries belonging to the same class (having the same value for the specified attributes), alternatively all geometries can be collected.

All output geometries will be converted to multi geometries, even those with just a single part. This algorithm does not dissolve overlapping geometries - they will be collected together without modifying the shape of each geometry part.

2
  • That is absolutely right... I've just found that out too. My problem was that I had the "Edit features In-Place" switch activated in the toolbox. Another option would be using the ST_Collect function in DB-Manager.
    – christoph
    Feb 16 at 8:48
  • Yes, ST_Collect is equivalent to this processing tool. they are the same just used at different places and maybe coded a bit differently
    – Kalak
    Feb 16 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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