-
Notifications
You must be signed in to change notification settings - Fork 944
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
Implemented turf-clusters-dbscan with spatial data structure (fix #2492) #2497
Conversation
I have another question: My implementation passed the In the previous implementation, the points are 2-dimentionally treated (longitude as X and latitude as Y). This calculation looks incorrect because the length of My implementation fixed this problem, but the result will be changed. ResourcesMy code for testing accuracyCode
Result
Other implementation of `regionQuery` that will not change the result from the original implementation
|
Thanks for your PR @TadaTeruki @mfedderly and @twelch will know more about this module than I do. Perhaps they have some questions for you? If I understand the above though, your new implementation passes all the existing tests. However you've found some places near the poles we were not testing, and your implementation gives different (more accurate?) results than the old implementation. Do you have some example locations you can attach where the different implementations give different results? |
Thank you for checking my pull request. @smallsaucepan I tested more to find some examples that give different results. That was caused by some bugs in my implementation. The result was fundamentally the same. |
Thanks for the detailed explanation @TadaTeruki and for your efforts with this 👍 |
I'm done. please check it |
89f80a6
to
553398d
Compare
Hi @TadaTeruki. There is another change you'll need to make before we can merge this. Looking at package.json the dependencies don't include rbush which your implementation now uses. This probably worked ok in development because other packages use rbush and it was already installed elsewhere. If someone installs @turf/clusters-dbscan only though, rbush isn't installed and the module can't be found. See turf-unkink-polygon for an example of how rbush is included. Similarly you can remove the density-clustering and @types/density-clustering dependencies at the same time as it is no longer required. Let us know when you've pushed this and we can take another look. Also reach out if you have any questions. |
If you would like to test deploying to a local registry for yourself, the steps are outlined in the wiki - https://github.com/Turfjs/turf/wiki/Contributing#deploy-to-a-local-node-registry |
Sorry for being late. Is there anything else I need to do? |
* Import 'RBush' for spatial indexing * Removed 'dbscan-clustering' * Reimplemented DBSCAN for performance * Test
* Write more comments
* Smaller bounding box for region query with RBush
* Use Bulk-Insertion for adding data to RBush tree * Slightly improved performance of region query
- remove unused packages - add rbush
3dcff4e
to
c8bb113
Compare
No need to apologise @TadaTeruki. Appreciate your help. I'll take a look and hopefully we can get this merged soon1! |
Thanks for all your work on this @TadaTeruki 👍 |
npm test
at the sub modules where changes have occurred.npm run lint
to ensure code style at the turf module level.Faster DBSCAN implementation for turf-clusters-dbscan.
Performance
Environment
Fixes #2492