<div dir="ltr">Hi,<div><br></div><div>This is not supposed to happen. </div><div><br></div><div>Can you please isolate the offending rows unioning them pairwise and file them as a ticket? Here's a handy helper function that returns True if Union failed:</div><div><br></div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"DejaVu Sans Mono""><span style="color:rgb(204,120,50);font-weight:bold">create or replace function </span><span style="color:rgb(255,198,109);font-style:italic">st_union_fails</span>(geom1 <span style="color:rgb(204,120,50);font-weight:bold">geometry</span><span style="color:rgb(204,120,50)">, </span>geom2 <span style="color:rgb(204,120,50);font-weight:bold">geometry</span>)<br> <span style="color:rgb(204,120,50);font-weight:bold">returns boolean<br></span><span style="color:rgb(204,120,50);font-weight:bold">as </span><span style="color:rgb(106,135,89)">$$<br></span><span style="color:rgb(204,120,50);font-weight:bold">begin<br></span><span style="color:rgb(204,120,50);font-weight:bold"> begin<br></span><span style="color:rgb(204,120,50);font-weight:bold"> </span>geom1 = <span style="color:rgb(255,198,109);font-style:italic">ST_Union</span>(Geom1<span style="color:rgb(204,120,50)">, </span>geom2)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(204,120,50);font-weight:bold">return false</span><span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(204,120,50);font-weight:bold">exception when others<br></span><span style="color:rgb(204,120,50);font-weight:bold"> then<br></span><span style="color:rgb(204,120,50);font-weight:bold"> return true</span><span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(204,120,50);font-weight:bold">end</span><span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50);font-weight:bold">end</span><span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(106,135,89)">$$<br></span><span style="color:rgb(204,120,50);font-weight:bold">language </span>plpgsql<span style="color:rgb(204,120,50)">;</span></pre></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">вт, 18 сент. 2018 г. в 16:25, Birgit Laggner <<a href="mailto:birgit.laggner@thuenen.de">birgit.laggner@thuenen.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div id="m_2151994923472200391zimbraEditorContainer" style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000" class="m_21519949234722003912"><div>Dear discussion group,<br></div><div><br></div><div>I am trying to ST_Union several polygons and get a TopologyException (GEOSUnaryUnion: TopologyException: found non-noded intersection between LINESTRING (3.56442e+06 5.42679e+06, 3.56442e+06 5.42679e+06) and LINESTRING (3.56442e+06 5.42679e+06, 3.56442e+06 5.42679e+06) at 3564420.7944701263 5426786.9800475985).<br></div><div>I have tested with ST_Valid and all polygons in the datasets are valid.<br></div><div><br></div><div>The dataset is pretty large (53.5 Mio. polygons) and will probably get grouped into around 8.7 Mio resulting geometries during ST_Union.<br><br></div><div>If I try to ST_Union the geometries near the point ST_Union mentions in the error message (ST_Buffer with up to 100 metres), everything works fine. I am out of ideas how to find the problematic geometry or at least how to work around the TopologyException.<br></div><div><br></div><div>My PostGIS version is: "POSTGIS="2.3.3 r15473" GEOS="3.5.1-CAPI-1.9.1 r4246" SFCGAL="1.2.2" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3" LIBJSON="0.11.99" TOPOLOGY RASTER"<br></div><div><br></div><div><br></div><div>I would be very glad if anyone would come up with ideas how to solve my problem.<br></div><div><br></div><div>Thanks a lot in advance!<br></div><div><br></div><div>Regards,<br></div><div>Birgit<br></div><div><br></div><div><br></div></div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Darafei Praliaskouski<br>Support me: <a href="http://patreon.com/komzpa">http://patreon.com/komzpa</a></div></div>