<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Well, the part I'm referring to is the 1. and 2 (Compute self-intersection nodes for A and B) as far as I understand.</div><div class="gmail_default" style="font-size:small">Traced through from <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/GeometryGraph.cpp#L393">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/GeometryGraph.cpp#L393</a> to <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp#L55">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp#L55</a> to <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp#L126">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp#L126</a></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Increased a counter here <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/</a> SimpleMCSweepLineIntersector.cpp#L161 and put a breakpoint here <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp#L166">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/index/SimpleMCSweepLineIntersector.cpp#L166</a></div><div class="gmail_default" style="font-size:small">counter's value at the end of the computeintersections was n*n, and breakpoint never hit, so a lot of checks were done without any useful work.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Not really sure how "representative" my polygons are, but they are squares with zig-zag boundaries</div><div class="gmail_default" style="font-size:small">/\/\/\/\/\/\/\/\</div><div class="gmail_default" style="font-size:small">\              /<br></div><div class="gmail_default" style="font-size:small">/              \<br></div><div class="gmail_default" style="font-size:small">\              /<br></div><div class="gmail_default" style="font-size:small">/              \<br></div><div class="gmail_default" style="font-size:small">\              /</div><div class="gmail_default" style="font-size:small">\/\/\/\/\/\/\/</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">don't know if that will come out right, but here's the snippet I used to check this:</div><div class="gmail_default" style="font-size:small">Geometry* getlargeGeo(double x, double y)<br>{<br>    int i;<br>    const int n = 1000;<br>    GeometryFactory::Ptr factory = GeometryFactory::create();<br>    CoordinateSequence* coords = factory->getCoordinateSequenceFactory()->create((size_t)0);<br>    for (i = 0; i < n; i++)<br>        coords->add(Coordinate(x + i * 10, y + (i % 2) * 3));<br>    Coordinate last = coords->getAt(coords->size() - 1);<br>    for (i = 0; i < n; i++)<br>        coords->add(Coordinate(last.x + (i % 2) * 3, last.y + i * 10));<br>    last = coords->getAt(coords->size() - 1);<br>    for (i = 0; i < n; i++)<br>        coords->add(Coordinate(last.x - i * 10, last.y + (i % 2) * 3));<br>    last = coords->getAt(coords->size() - 1);<br>    for (i = 0; i < n; i++)<br>        coords->add(Coordinate(last.x + (i % 2) * 3, last.y - i * 10));<br>    coords->add(coords->getAt(0));<br><br>    LinearRing *shell = factory->createLinearRing(coords);<br>    return factory->createPolygon(shell, NULL);<br>};</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">...</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">    Geometry* lg1 = getlargeGeo(0, 0);<br>    Geometry* lg2 = getlargeGeo(100, 50);<br>    Geometry* res3 = lg1->intersection(lg2);<br><br></div><div class="gmail_default" style="font-size:small"><br></div></div></div></div></div></div></div></div></div>