OSMnx可视化在Folium上的边缘中心度图

编程入门 行业动态 更新时间:2024-10-24 02:37:00
本文介绍了OSMnx可视化在Folium上的边缘中心度图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用以下代码在边缘上绘制边缘中心度图

I'm trying to plot the graph of edge centrality on the folium using the following code

graph_map = ox.plot_graph_folium(G, popup_attribute='name', tiles='stamenterrain', edge_color=ec, edge_width=2)

其中,ec是边缘颜色的列表,但未显示. edge_color是否接受颜色列表?有什么想法吗?

where ec is list of edge colors but it is not showing up. Does edge_color accept a list of colors ? Any ideas?

如果您能帮助我,我非常感谢.

I really appreciate if you can help me.

github /gboeing/osmnx-examples/blob/master/notebooks/08-example-line-graph.ipynb

推荐答案

我尝试将新的边缘颜色列添加到图形边缘的gdf

I tried adding a new column of edge color to gdf of the graph edges

gdf_edges = ox.graph_to_gdfs(G, nodes=False, fill_edge_geometry=True) gdf_edges['edge_color'] = ec

然后修改两个功能

make_folium_polyline(edge, edge_width, edge_opacity, popup_attribute=None)

plot_graph_folium(gdf_edges, graph_map=None, popup_attribute=None, tiles='cartodbpositron', zoom=1, fit_bounds=True, edge_width=5, edge_opacity=1)

达到最终结果:

更多推荐

OSMnx可视化在Folium上的边缘中心度图

本文发布于:2023-11-30 03:08:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648520.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边缘   中心   OSMnx   Folium

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!