<div dir="ltr"><div dir="ltr">re why so many PIP checks - actually I don't think there are that many, relatively speaking.  There are O(n+m) PIP checks, where n and m are the number of rings in the two geometries.  In this case that is about 4300.  That is a small number relative to the total number of vertices.  And with the envelope test each PIP test is pretty fast, so this step probably doesn't take a very large percentage of the overall time.  So indexing probably won't move the needle much here.<div><br></div><div>This would be worse for a pathological geometry with the same order of magnitude of holes as vertices (e.g. a Sierpinkski carpet [1]).  And would be even worse for computing the intersection of two *nested* Sierpinksi carpets.    But doubt that happens very often in the real world... :)</div><div><br></div><div>[1] <a href="https://en.wikipedia.org/wiki/Sierpinski_carpet">https://en.wikipedia.org/wiki/Sierpinski_carpet</a></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 4:29 PM Martin Davis <<a href="mailto:mtnclimb@gmail.com">mtnclimb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It turns out that the SimplePointInAreaLocator envelope check has been in place in JTS for quite a while.  Guessed it got missed as a item to port.<div><br></div><div>Still have to think about whether indexing would improve things.  And I don't see right now why there needs to be so many PIP checks at all, since the hole assignment is known at the outset in this case.<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 3, 2018 at 1:40 PM Paul van der Linden <<a href="mailto:paul.doskabouter@gmail.com" target="_blank">paul.doskabouter@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">Ok, first test with my big polygon and the envelope tests in place is giving a 27% speedup!</div><div style="font-size:small"><br></div></div><br></blockquote></div></div></div>
</blockquote></div>