<div dir="ltr">Here's another postgis solution. I started with your original QGIS union which has 12 polygons. Then in postgis:<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">select st_union(geom) as unique_geom, string_agg(attrib, ',') as concatenated_attribute</font></div><div><font face="monospace">from test </font></div><div><font face="monospace">group by geom;</font></div></blockquote>This is an aggregate query the groups by geometry. The "magic" is the string_agg function which concatenates the "attribute" field. The query produces 7 rows (below). The string_agg() function also accepts an ORDER BY if that's important to you.<div><img src="cid:ii_mlqt84i12" alt="image.png" width="495" height="437"><br></div><div><div><br></div><div><br><div><br></div></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Feb 17, 2026 at 8:23 AM Karl Magnus Jönsson via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg4770716411992134382">
<div lang="SV" style="overflow-wrap: break-word;">
<div class="m_4770716411992134382WordSection1">
<p class="MsoNormal"><span style="font-size:11pt">Hi Simon!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt">Seems like a common problem that GIS should handle easy, but it is perhaps not that easy. I had a similar problem that ended up in below. I have my data in Postgres + PostGIS so it is handled
by the database in in a view. The code disassembles the polygons in the rings, union the rings and then build polygons again from the lines. Then I do a join with the original data (in this case not exactly) based on location on the centerpoint. In your case
I would do a suitable group by and concatenate the attributes. Hope this helps even it is not QGIS.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt">WITH orings AS (<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> SELECT st_exteriorring((st_dumprings((st_dump(omr.geom)).geom)).geom) AS geom<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> FROM qdp2.omr<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> ), oboundaries AS (<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> SELECT st_union(orings.geom) AS geom<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> FROM orings<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> ), opoly AS (<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> SELECT (st_dump(st_polygonize(oboundaries.geom))).geom AS geom<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> FROM oboundaries<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> )<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt">SELECT row_number() OVER () AS id,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> </span><span style="font-size:11pt">p.namn,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> 'delområde'::text AS delomr,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> </span><span lang="EN-GB" style="font-size:11pt">p.plan_uuid,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> p.status,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> p.publicerad,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> op.geom<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> FROM opoly op,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> qdp2.plan_omr po,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> qdp2.plan p<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"> WHERE st_contains(po.geom, st_pointonsurface(op.geom)) AND po.plan_uuid = p.plan_uuid<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Franklin Gothic Book",sans-serif;color:black">Med vänliga hälsningar<u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:"Franklin Gothic Book",sans-serif;color:black"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:"Franklin Gothic Book",sans-serif;color:black">Karl-Magnus Jönsson</span></b><span style="font-size:11pt"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">Från:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> QGIS-User
<<a href="mailto:qgis-user-bounces@lists.osgeo.org" target="_blank">qgis-user-bounces@lists.osgeo.org</a>> <b>För </b>Simon Dietmann via QGIS-User<br>
<b>Skickat:</b> den 17 februari 2026 15:01<br>
<b>Till:</b> qgis-user <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a>><br>
<b>Ämne:</b> [Qgis-user] aggregate polygon overlay<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="DE">Dear list,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="DE"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I am trying to solve the following problem:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I have one polygon layer with many polygons that are in many cases overlapping and with different attribute valus, e.g. a, b, c:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><img width="406" height="387" style="width: 4.2291in; height: 4.0312in;" id="m_4770716411992134382Grafik_x0020_1" src="cid:ii_19c6c5782394cff311"></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">My goal is to generate a polygon layer with polygons for every overlap constellation containing a concat string of those attributes, in this example seven polygons with the attributes a, b, c, ab, bc, ac, abc.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I started with a union of my original layer, the result is a layer with 12 polygons where overlapping areas of the original polygons result in overlapping intersections containing one of the original attributes each,
for example in the middle, there are 3 polygons, one with a, one with b and one with c.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">How is it possible to summarize those overlapping polygons into one polygon each with all the attributes, given that there is a large number of polygons and different attributes?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thank you for any hints,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">regards<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p><span lang="DE" style="font-size:10pt;font-family:Arial,sans-serif;color:black">i.A. Simon Dietmann<br>
Projektleiter | Geograph</span><span lang="DE" style="font-family:Arial,sans-serif;color:black"><br>
<br>
</span><span lang="DE"><u></u><u></u></span></p>
<p><span lang="DE"><img width="204" height="89" style="width: 2.125in; height: 0.927in;" id="m_4770716411992134382Bild_x0020_2" src="cid:ii_19c6c5782395b16b22"></span><span lang="DE"><u></u><u></u></span></p>
<p><span lang="DE" style="font-size:9pt;font-family:Arial,sans-serif;color:gray">PGNU Planungsgesellschaft Natur & Umwelt mbH<br>
Amtsgericht Frankfurt am Main, HRB 111938; <br>
Geschäftsführer: Dr. Benjamin Hill, Dorit Thurm, Sebastian Braun<br>
Hamburger Allee 45 +++ 60486 Frankfurt am Main<br>
Durchwahl: +49 69 952964-32 +++ Fax: +49 69 952964-99<br>
E-Mail: <a href="mailto:dietmann@pgnu.de" target="_blank">dietmann@pgnu.de</a> +++ Web: <a href="http://www.pgnu.de" title="http://www.pgnu.de" target="_blank">
<span style="color:gray">www.pgnu.de</span></a></span><span lang="DE" style="font-size:7.5pt;font-family:Arial,sans-serif"><br>
</span><span lang="DE" style="font-size:8pt;font-family:Arial,sans-serif"><br>
<span style="color:rgb(153,153,153)">> Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten
Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.<br>
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution
of the material in this e-mail is strictly forbidden.</span></span><span lang="DE"><u></u><u></u></span></p>
</div>
</div>
_______________________________________________<br>
QGIS-User mailing list<br>
<a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</div></blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Richard W. Greenwood<br></div></div>