mapbox / which-polygon

Index for matching points against a set of GeoJSON polygons
ISC License
133 stars 14 forks source link

expose rbush tree, allowing extra flexibility if needed #2

Closed tcql closed 8 years ago

tcql commented 8 years ago

When using which-polygon to determine what country a tile belongs to, I found some edge cases where I need access to the rbush tree to handle cases where a single point test is insufficient. Rather than build a second copy of the rbush tree, it seems easier and more logical to just expose the tree used internally in which-polygon.

mourner commented 8 years ago

Instead of this, I'm thinking of implementing an efficient "bbox intersects polygon" algorithm, which would be faster than doing lineclip.