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

Proposal new module distance-clustering #811

Closed
2 tasks done
stebogit opened this issue Jun 21, 2017 · 6 comments
Closed
2 tasks done

Proposal new module distance-clustering #811

stebogit opened this issue Jun 21, 2017 · 6 comments

Comments

@stebogit
Copy link
Collaborator

stebogit commented Jun 21, 2017

Continuing the discussion started in #787, ref. also #33

@cyrilchapon as @DenisCarriere said we should not merge the two clustering strategies, but rather create a new module.
My question about the use of the distance clustering was not on the API, but more about an example of application, to try to understand better how to design input and output.
Reading the article provided by @DenisCarriere, kdbush seems to be a great tool to index the points, but then you need to query the generated tree to perform the clustering.
What I don't quite get yet is how you would exactly use maxDistance to group the points...
Or maybe for each point you want a FeatureCollection of points that are within that distance?

Once we defined that we might want to define two clustering modules:

  • @turf/clusters-kmeans (currently @turf/clusters)
  • @turf/clusters-distance @turf/clusters-dbscan
@cyrilchapon
Copy link

@stebogit, my original use-case was this one. It was db-oriented question but the main purpose is now I'm using to preprocess some stuff for insert/updates on mongo. In that particular case, it's a common use-case tu aggregate some location points from IOT networks for example.
maxDistance (actualité this is lire like minDistance) factor would be the "maximal distance between 2 points before jumping to a new cluster". Or maybe the "minimal distance between 2 points to be considered as a cluster". But it shouldn't "jump" from point to point, it would be more like the mac radius of a circle containing all points of a cluster.

@DenisCarriere
Copy link
Member

DenisCarriere commented Jun 21, 2017

Another library that might be useful to create the distance cluster is geokdbush (created by @mourner ) which will allow you to find the closest points using geokdbush.around.

@DenisCarriere
Copy link
Member

Lets develop both for now, and lets see at the end if we should combine them together or not.

@stebogit I'll be working on clusters-distance today, I've got an idea how I can tackle it.

@stebogit
Copy link
Collaborator Author

stebogit commented Jul 15, 2017

Implemented with #812 🎉

@cyrilchapon maybe you want to check the brend new @turf/clusters-dbscan out, I believe it might help with your use-case

@cyrilchapon
Copy link

Hello, and thanks about this.
I realy don't know why I'm not receiving any notification anymore oO.

It looks amazing, and I'm glad to have a brand new use-case to test it : I'm willing to display accidentology data, and I think I'm going to aggregate it to create "accident zones" rather than "accident points". This is gonna be exiting to test that feature.

I have to say I'm very impressed, by turf community. I find it pretty rare when you take some time to express a need, but you don't explicitly have time to dedicate to an opensource repo, to get a real feedback from a community. Plus feature and bug tracking on turf repo is fantastic.

If I get to have time to contribute, soon, I'll definately start with turf.

@DenisCarriere
Copy link
Member

@cyrilchapon Thanks for the great positive feedback 😍

If you want to check out a live example of the "density cluster" library (@turf/clusters-dbscan).

https://github.com/DenisCarriere/turf-example-clusters-dbscan

checkout the source code here:

https://github.com/DenisCarriere/turf-example-clusters-dbscan

image

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

3 participants