<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 2, 2018 at 8:04 AM Paul van der Linden <<a href="mailto:paul.doskabouter@gmail.com">paul.doskabouter@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 dir="ltr"><div style="font-size:small"><br></div><div style="font-size:small">I also noticed that in <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/algorithm/locate/SimplePointInAreaLocator.cpp#L49" target="_blank">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/algorithm/locate/SimplePointInAreaLocator.cpp#L49</a> and/or <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/algorithm/locate/SimplePointInAreaLocator.cpp#L72" target="_blank">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/algorithm/locate/SimplePointInAreaLocator.cpp#L72</a> there's no envelope-check done</div></div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>Yes, that's a good point.  The original reason for not including an envelope check is following the JTS design principal of not doing checks which may have already been done externally.  But in this case the check is fairly low-cost, and not including it is (obviously) a common source of inefficiency.  So it makes sense to add an envelope check into the default code path.  (If an unchecked path is needed that could be added as a separate method). </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 dir="ltr"><div style="font-size:small"><br></div><div style="font-size:small">Another thing: as that pointinpolygon is going to be called from <a href="https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/EdgeEndStar.cpp#L165" target="_blank">https://github.com/libgeos/geos/blob/8bc1ea0f8019bcb83c60126e7883ae428ea7c677/src/geomgraph/EdgeEndStar.cpp#L165</a> and findEdgeRingContaining quite a number of times, perhaps its possible to prepare the lot and use a IndexedPointInAreaLocator?<br></div><div style="font-size:small"><br></div></div></div></div></div></div></div></div></div></div></blockquote><div>You have found an area in the overlay code which isn't optimized as much as it could be.  Although whether it's worth building an index on the holes depends on the number of holes and rings that are being checked.  But for geometries with many holes it might be advantageous.  Are you going to test this? </div></div></div>