-
Notifications
You must be signed in to change notification settings - Fork 300
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
How to run supercluster as server side clustering #124
Comments
Duplicate of #79 |
hi @jpnathannew did you make any progress? I am working on the same problem. Maybe we can help each other? |
hi @xlcrr! What is the problem you trying to solve? You can follow these steps with nodejs app:
|
Hi @kityan thanks for the message I am using Laravel PHP framework on the backend. Once the client has the data, processing it with supercluster is incredibly fast (100's ms). The slowest part seems to be getting the data from the table into the browser (9-10s for 100,000 points and growing on virtual machine) therefore I would like to save the clusters to a table and update this with a script on the backend. I am still trying to figure out how to do this but I am thinking about passing the data into a javascript file and execute it on the backend with |
@xlcrr the main idea is not to send 100k points to client for clusterization. For my project I have splitted front end code: for some zoom levels (e.g. 9-18) it requests backend for points (here you can use directly your php backend). For other zoom levels (e.g. 1-8) it requests backend for CLUSTERS not for POINTS. And here nodejs app with Supercluster comes in. You can proxy with web-server (nginx, etc) or via your php code. |
@xlcrr My advice: do not store clusters index to db (I am not really sure that Supercluster's index is serializable). In this case your P.S. Moreover, you should expect that number of clusters on higher zooms can be very close to number of points (depends on cluster radius). So you could have a lot of data. It is also a reason no to try storing clusters to database on each clusters index rebuild but to serve them from nodejs app. |
@kityan thank you very much for the reply. I will do some research and report back |
@kityan I decided to save zoom levels to DB see https://openlittermap.com/global :-) |
@xlcrr, well done! I don't think that it's the best solution (to store clusters to DB and not to serve them from standalone app), especially if you have to reindex clusters frequently. But, anyway. My backend is always nodejs, so it's more convenient to me. |
@xlcrr P.S. A little more about pros and cons. When I use standalone app to handle frontend requests I can use |
@kityan I have recently launched OpenLitterMap as open source. You can see my backend PHP implementation here. Can't believe we chatted before that's great! Sounds like an awesome implementation, well done! We will see what the emerging OLM community can recommend as refactoring this atm is currently outside my timeframe |
Have any postgis implementation? |
I am creating server side clustering for my map. When I use PHP and Mysql for create the clustering it is taking more time. So I am planning to use this project
I have few doubts
Please help me. I am waiting for your response
The text was updated successfully, but these errors were encountered: