tidwall / geojson

GeoJSON for Go. Used by Tile38
MIT License
130 stars 28 forks source link

geometry: Added minimal bounding rectangle optimization to ring "Contains/Intersects" functions in which is was not present before #19

Closed lior5654 closed 2 years ago

lior5654 commented 2 years ago

Significantly important in cases in which high performance is critical and a large count of objects (most of which could be outside the bounding box) are queried against a ring consisting of a high number of points

tidwall commented 2 years ago

Hi, except for the addition of notFoundIdx change, I'm good with this PR.

It's a preference of mine to return -1 for a "not found" result. Specifically for methods that perform zero-based index searches.

lior5654 commented 2 years ago

Hi, except for the addition of notFoundIdx change, I'm good with this PR.

It's a preference of mine to return -1 for a "not found" result. Specifically for methods that perform zero-based index searches.

fixed in the last commit, can you approve now?

Cc: @tidwall

tidwall commented 2 years ago

It'll take me a bit to merge. I need to run some manual tests locally first.

tidwall commented 2 years ago

But otherwise, LGTM 👍