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

Collision Issue #39

Closed
nerdherdwa opened this issue Jan 15, 2020 · 9 comments
Closed

Collision Issue #39

nerdherdwa opened this issue Jan 15, 2020 · 9 comments
Assignees

Comments

@nerdherdwa
Copy link

Awesome work on this looks great when rendering out data points and has solved an issue with rendering 5k+ markers with leaflet. The issue im having is that im using the demo for the french cities as i like the way the markers are rendered, but when it comes to process collision on my datasets it is either crashing the browser or takes a very long time to calculate. And im assuming its the density of the points that is crashing my browser. As i have some datasets that its rendering 126k markers in about 33s but then i have a dataset of only 2k and the browser crashes during the quadtrees calculation. The largest dataset that i have passed through is 477K markers which actually renders the points but takes 12578s to complete the process. Any suggestions on how to improve the processing of these points faster or more efficiently. I want to continue to use the code in my application but struggling to find a solution to improve the processing of the points.

some examples of the results that im getting, though the first one did take some time to render (477K markers)

GLD_WOD_Data_Zoom

CTD_WOD_Data

MBT_WOD_Data

@manubb
Copy link
Owner

manubb commented Jan 19, 2020

Hi. Nice pictures!
Can you try to decrease the size of the markers? (i agree though that this is not a good solution...)

@manubb
Copy link
Owner

manubb commented Jan 19, 2020

Can you upload the 2k dataset that crashes the fix collision function? (so that i can test it and see what can be done).

@nerdherdwa
Copy link
Author

mrb.zip

Here is zip file of the json file with the data that crashes browser when attempting to create zoom level between 5 and 16. I can get it to render the page if i only put one zoom level but not really a solution considering the density of the points.

WOD_Data_MRB_Zoom5_10598pts
WOD_Data_MRB_Zoom8_809pts_(-23 72501,10089844)
WOD_Data_MRB_Zoom8_4582pts_(-10 90895,93 60339)
WOD_Data_MRB_Zoom9_2000pts_(-8 8339,163 37151)

@nerdherdwa
Copy link
Author

Any feedback on the density of points when trying to calculate the collision positions

@manubb manubb added the wip label Feb 26, 2020
@manubb manubb self-assigned this Feb 26, 2020
@manubb
Copy link
Owner

manubb commented Feb 26, 2020

Hi. Sorry for the delay but i think that i found the root of the problem.
Can you tell if the problem happens randomly on the 2k dataset? (Sometimes the computation succeeds in a few seconds and sometimes it fails after a much longer times.)

@manubb
Copy link
Owner

manubb commented Feb 28, 2020

I've pushed a new circles.js file that fixes the crashes with the 2k dataset. Can you check on your side?

@manubb manubb removed the wip label Feb 28, 2020
@manubb
Copy link
Owner

manubb commented Feb 28, 2020

I've added a demo with the 2k dataset here.

@nerdherdwa
Copy link
Author

@manubb no worries the areas where i had issues with small amounts of points rendering due to density of the points, now seems fixed when using the new circle.js file, they render all the points with out the browser crashing. It was always crash would only render once i reduced the number of points to around 500

7k points rendered at a position was previously crashing

7000pts

Thanks for your help my next option was cluster at the postgis database api and then only render one cluster point out for those areas that had issues

@manubb
Copy link
Owner

manubb commented Feb 28, 2020

The collision fix function was not designed to handle efficiently many points sharing same position. If you still have performance issue with the 477k dataset, you can consider doing some preprocessing to fix collisions on the same position clusters.

@manubb manubb closed this as completed Feb 28, 2020
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

2 participants