<div dir="ltr"><div>Thanks for testing, Even.</div><div><br></div><div>Interestingly, in JTS the test case you give below for OverlayNG.intersection actually returns the same result as the old code:</div><div><br></div><div>MULTILINESTRING ((833978.557030887 0, 835092.849076364 0), (832864.275023695 0, 833978.556808034 0))<br></div><div><br></div><div>So this is something to look into on the GEOS side.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 17, 2020 at 4:39 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</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"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px"><br></p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">The intersection of the input geometry with this multipolygon of 2 parts can be shown with:</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">from osgeo import ogr</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"># input geometry crossing the antimeridian (UTM 60N)</p>
<p style="margin:0px;text-indent:0px">geom = ogr.CreateGeometryFromWkt('LINESTRING(832864.275023695 0,835092.849076364 0)')</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"># multipolygon with one part left to the antimeridian, one part right</p>
<p style="margin:0px;text-indent:0px">geom2 = ogr.CreateGeometryFromWkt('MULTIPOLYGON (((832864.275023695 0.0,833978.556808034 -0.000110682755987,833978.556808034 0.0,833978.556808034 0.000110682755987,832864.275023695 0.0,832864.275023695 0.0)),((835092.849076364 0.0,833978.557030887 -0.000110682755987,833978.557030887 0.0,833978.557030887 0.000110682755987,835092.849076364 0.0,835092.849076364 0.0)))')</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"># intersection</p>
<p style="margin:0px;text-indent:0px">print(geom.Intersection(geom2))</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">With OverlayNG, the following leads to a LINESTRING EMPTY, whereas with GEOS 3.8something, it leads to the expected result of</p>
<p style="margin:0px;text-indent:0px">MULTILINESTRING ((832864.275023695 0.0,833978.556808034 0.0),(833978.557030887 0.0,835092.849076364 0.0))</p>
</div></blockquote></div></div>