<div dir="ltr"><div dir="ltr">Dennis and list<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 3, 2023 at 11:45 AM Dennis Burgess 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="msg7700024878277336238">





<div style="overflow-wrap: break-word;" lang="EN-US">
<div class="m_7700024878277336238WordSection1">
<p class="MsoNormal"><span style="font-size:12pt">Ok, has to be a simple solution.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt">I have a GPKG file that is around 50 meg.  This has multiple layers or at least I can see multiple layers.  I.e. I have one polygon on top of another<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt">What I want is to flatten these, to where ONLY the exact area that is show is displayed in the smallest file possible. 
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt">Union is the way to do this but its SLOW SLOW..  any other options… ?
</span></p></div></div><br></div></blockquote><div><br></div><div>Are the overlapping polygon geometries "the same", ie boundaries are coincident?  If that's the case, then the attributes from each polygon refer to exactly the same and you could just pick one of the layers and join the attributes on from the other layers.</div><div><br></div><div>If the geometries are distinct, union is one choice.  Another might be to convert all the polygons to linestrings, merge the linestrings into one layer, convert the merged linestrings back to polygons and then use spatial join to transfer the attributes back to the new polygons.  Not sure if that would be faster.  One potential problem with this general sort of problem is the creation of many tiny polygons where the linework is not quite coincident.  This can certainly mess with your concept of "the exact area".<br></div><div><br></div><div>Rasterizing the polygons, overlaying, then vectorizing might be another choice.</div><div><br></div><div>I think it's probably hard to say "what's best" or "what's simplest" without actually seeing an example of the overlap.<br></div></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Chris Hermansen · clhermansen "at" gmail "dot" com<br><br>C'est ma façon de parler.</div></div></div>