简体   繁体   中英

Google Maps - Server-side Clustering

I've got about 500 000 markers and naturally I cannot display them all. I've tried MakerClusterer but it was too complex for js to plot clusters on map. I was thinking on server-side clusterer but it was much slower than javascript solution!!!

Do you know any solution of this problem? I know that 500 000 is very huge number but php should be at least as fast as js. That's probably a matter of implementation. Perhaps there is some other solution like this that is known to be efficient?

Thanks

You want to look for a space-filling-curve or a spatial index (database). A sfc reduce the 2d complexity to a 1d complexity. You want to look for Nick's hilbert curve quadtree spatial index blog. BTW. I've implemented a php class to use a hilbert curve to search for postcodes. It's using a table non-recursive approach and can use all 4 hilbert-curves. You can find my class at phpclasses.org (hilbert-curve).

If you don't mind using Django, you can try my app:

https://github.com/biodiv/anycluster

It uses postgis kmeans clustering. You can easily adapt the mechanisms to your map eg by choosing between gridcluster/kmeanscluster depending on zoom level for optimizing the performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM