-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added bbox test #3
Conversation
This may be a bit confusing since you do checks against geometry in polygon tests, but don't do it with bbox. So maybe it's not worth exposing as a public query method, because users would expect it to behave properly. |
oh good point. I kind of spaced out and threw this together real fast. We could use |
@mourner updated to use lineclip to validate matches |
return false; | ||
}).map(function (el) { | ||
return el[5]; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a simple loop like in query
instead of two filter/map closures for consistency.
updated 👍 |
@tcql @ingalls Rebased against master and was about to merge, but just realized that the bbox check is not always correct. One counter-case that comes to mind is when bbox center is inside a hole which is fully contained within the bbox. Then bbox intersects the polygon, while the outer ring doesn't intersect the bbox. This needs another thought... |
Fixed the edge case above and published as 2.1.0. |
Thanks a ton @mourner ! Will get the mbtiles-extrats PR updated to point at this version. |
querying with a bbox returns properties for all polygons that it touches.
If there's only one hit, just the match is returned instead of an array.
still exposed the rbush tree, in case anybody using
which-polygon
requires additional access.