【问题标题】:GeoDjango: Clustering of large number of markersGeoDjango:大量标记的聚类
【发布时间】:2012-06-05 17:20:18
【问题描述】:

你好 Stackoverflow 的人,

我开始使用 GeoDjango,当我遇到 Google 地图 v2 实现 django.contrib.gis.maps.google.overlays 时,我感到非常高兴。不再是最新的,因为 v2 已被贬值,但仍然是一个非常紧凑的工具,可以简单地在地图上显示标记

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
{{ google.xhtml }}
<head>
  {{ google.style }}
  {{ google.scripts }}
</head>
<body onload="{{ google.js_module }}.map_load()" onunload="GUnload()">
  <div id="{{ google.dom_id }}" style="width:600px; height:400px;"></div>
</body>
</html>

代码取自here

基于这个非常紧凑的代码,我如何实现clustering function?我读过 GeoDjango 目前不支持集群。 有没有人使用django.contrib.gis.maps.google.overlays 实现集群?还是自己编写完整函数并遍历所有列表条目以创建标记的更好方法?

感谢您分享您的经验和建议。

【问题讨论】:

  • kmeans 是用于聚类的常用方法,请在此处搜索。考虑到 bbox 和缩放级别,您可能需要实现自己的视图。
  • 明白为什么这被否决了。

标签: django google-maps google-maps-markers geodjango markerclusterer


【解决方案1】:

您可以尝试我的 geodjango 集群应用程序进行服务器端集群:

https://github.com/biodiv/anycluster

它使用 kmeans 和/或网格。

【讨论】:

    猜你喜欢
    • 2011-07-05
    • 2013-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多