Skip to content
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

Utilise spatial indexing to make things fast #33

Open
fnorf opened this issue Nov 25, 2016 · 1 comment
Open

Utilise spatial indexing to make things fast #33

fnorf opened this issue Nov 25, 2016 · 1 comment

Comments

@fnorf
Copy link
Contributor

fnorf commented Nov 25, 2016

Use https://github.com/mourner/rbush to create a spatial index that can be utilised for all the intersection tests and operations. Something like:

  • Get the extends of each feature and use some attribute for referencing original geometry -> rbush item
  • Load them all into the index (bulk!)
  • Instead of using turf.intersects/intersection use tree.search(extends) to find likely candidates
  • Only then use turf.intersects/intersection on the actual geometries of only those candidates

This will probably drastically speed up this tool! :)

@fnorf
Copy link
Contributor Author

fnorf commented Nov 25, 2016

Made a quick proof of concept #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant