-
Notifications
You must be signed in to change notification settings - Fork 14
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
Explode MultiPolygons when loading #6
Comments
👍 Agreed, we can include
This shouldn't be applied to the initial loading of the FeatureCollection since MultiPolygon is treated as a single feature and not multiple features. @mojodna If you feel like doing a PR, I can definitely help review it 👍 |
Can you elaborate a bit on this? It sounds like I can simplify the second block of code ☝️ by using that in the absence of a patch to
Yup, that makes sense. I was realizing after I opened this issue that a side-effect is that the features that come out of the index aren't necessarily the ones expected. I will try to find time to do a PR (🙏 for the review offer), but I'm not sure I'll have time before disappearing again. |
Sounds like a plan! 👍 |
I was thinking about this a bit more; I think the bulk of the performance improvement I'm seeing is actually related to intersecting against |
I'm using martinez to intersect features w/ candidates from rbush in order to do strict intersections:
COUNTRY_INDEX
is Natural Earth admin 0 boundaries, many of which areMultiPolygon
s that include territories. As a result, the bboxes produced for the USA, Canada, and Russia cover much of the world. By splitting theMultiPolygon
s into multiplePolygon
features, I get a substantial speed-up because fewer indexed features match:Doing this automatically within geojson-rbush seems like it would provide a transparent speed-up for those using
MultiPolygon
s.The text was updated successfully, but these errors were encountered: