Google 地图 - 服务器端集群
我有大约 500 000 个标记,自然无法全部显示。我尝试过 MakerClusterer 但是对于 js 来说在地图上绘制集群太复杂了。我正在考虑服务器端集群器,但它比javascript解决方案慢得多! !!
你知道这个问题有什么解决办法吗?我知道 500 000 是一个非常大的数字,但 php 至少应该和 js 一样快。这可能是一个实施问题。也许还有其他类似的已知有效的解决方案?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您还可以查看如何使用 Fusion Tables http://code .google.com/apis/maps/documentation/javascript/overlays.html#FusionTables
You can also have a look at using Fusion Tables http://code.google.com/apis/maps/documentation/javascript/overlays.html#FusionTables
您想要寻找空间填充曲线或空间索引(数据库)。 sfc 将 2d 复杂度降低为 1d 复杂度。您想查找 Nick 的希尔伯特曲线四叉树空间索引博客。顺便提一句。我已经实现了一个 php 类来使用希尔伯特曲线来搜索邮政编码。它使用表非递归方法,并且可以使用所有 4 条希尔伯特曲线。您可以在 phpclasses.org (hilbert-curve) 找到我的课程。
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).
如果您不介意使用 Django,可以尝试我的应用程序:
https://github.com/biodiv/anycluster< /a>
它使用 postgis kmeans 聚类。您可以轻松地使这些机制适应您的地图,例如,根据缩放级别在 gridcluster/kmeanscluster 之间进行选择,以优化性能。
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 e.g. by choosing between gridcluster/kmeanscluster depending on zoom level for optimizing the performance.