用大叶草绘制标记有限制吗?

elb*_*kim 7 python plot pandas folium data-science

我正在策划美国空军在朝鲜战争期间对朝鲜执行的任务。

以下是包含 2800 个地块的地图。

在此处输入图片说明

我总共有大约 7500 个绘图,但是每当我尝试绘制高于 2800 的绘图时,都会呈现一个空白地图。我正在 PC 笔记本电脑上渲染。如果我使用桌面会渲染吗?或者这是对大叶的限制?

我不是在猜测这是数据的问题。如果有人想探索它,我将分享坐标数据:链接到公共 Excel 表。

小智 8

正如@Bob Haffner 建议您可以使用 Folium 库中的 FastMarkerCluster。这是我的代码,在我的文件中有 ~500K 点。

import pandas as pd
import json
from folium.plugins import FastMarkerCluster

rome_lat, rome_lng = 41.9028, 12.4964
with open("file_name.json", 'r') as f:
  # create a new DataFrame
  samples = pd.DataFrame(json.loads(f.read()))        
# init the folium map object
my_map = folium.Map(location=[rome_lat, rome_lng], zoom_start=5)
# add all the point from the file to the map object using FastMarkerCluster
my_map.add_child(FastMarkerCluster(samples[['latitude', 'longitude']].values.tolist()))
# save the map 
my_map.save("save_file.html")
Run Code Online (Sandbox Code Playgroud)

这段代码需要大约 10 毫秒来渲染地图。

有关更多详细信息示例,请访问此链接: FastMarkerCluster 示例

希望这是有帮助的。