本文介绍了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上的边缘中心度图
发布评论