gpt4 book ai didi

python - 在 map 上放置更多的 folium/leaflet 元素

转载 作者:太空宇宙 更新时间:2023-11-04 04:25:05 25 4
gpt4 key购买 nike

Folium 是基于 Leaflet.js 使用 Python 制作交互式 map 的绝佳工具。

这里我用它在 map 上绘制图形。

the_map = folium.Map(tiles="cartodbpositron")
for (u, v) in G.edges():
if (not bbox) or (in_bbox(u) and in_bbox(v)):
folium.PolyLine(
locations=[positions[u][::-1], positions[v][::-1]],
weight=edge_size_attr[frozenset((u,v))],
color=get_edge_color(u, v),
tooltip=get_edge_tooltip(u, v)
).add_to(the_map)
return the_map

工作正常。唯一的问题是可以用这种方式绘制的边数有硬性限制。超过几百,Leaflet 似乎认输了,不再渲染 map 。

我可以做些什么来突破极限并绘制更多的节点和边吗?

enter image description here

最佳答案

一种可能的解决方案:

jupyter notebook --NotebookApp.iopub_data_rate_limit=<LARGE_NUMBER>

启动 jupyter 笔记本时,您可以允许更高的 iopub 速率,(@ https://github.com/jupyter/notebook/issues/2287 使用了 LARGE_NUMBER==10000000000)。

请谨慎行事,jupyter 在这里设置了一个下限以避免使您的客户端崩溃。

关于python - 在 map 上放置更多的 folium/leaflet 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53655579/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com