

Use Menu Processing / Toolbox / Aggregate with the original polygon layer as input to dissolve all features based on the group field created in step 3. Use this expression in the field calculator: array_first (overlay_intersects( 'singleparts', $id)) where singleparts is the name of the layer created in step 2. On the orginal layer, create a new field named grouped that adds a unique identifier for the group of polygons each of the original polygon features is part of. Using only QGIS, you can achieve this as follows:Īpply Multipart to singleparts to the dissolved polygons: you get one feature for each connected group of polygons.
Combine polygon groups in cheetah3d code#
If your answer involves SQL or Python, please consider that I am learning these now but an absolute beginner, so I will not understand code without context. I'd like to stay within QGIS if possible (I have never used PostGIS before). This seems like a fairly common task that it should be possible to accomplish, but my searches have been fruitless thus far. isolated ones without an adjacent neighbor) there is no change to their attributes.

If these two polygons merge into Polygon AB, I would like the corresponding value of attribute 'status' to be "IC, NC".)įor polygons not being merged (i.e. (Example: For attribute 'status', Polygon A has value "IC" and Polygon B has value "NC". I would like to accomplish this in a way that preserves all of the attributes for all polygons, for example:įor polygons being merged: values for attribute X are concatenated for the resulting polygon. If all of the adjacent polygons are merged, I will end up with between 100 and 200 (larger) polygons. I have a layer of 1000+ polygons, many of which are adjacent (touching, overlapping, or one completely inside another).
