osmnx获取中心点,OSMnx可视化叶片上边缘中心的图形

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

bd3e80d01e4537cc4fa4a2f724336b05.png

graph_map = ox.plot_graph_folium(G,

popup_attribute='name',

tiles='stamenterrain',

edge_color=ec,

edge_width=2)

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.

解决方案

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

Then modify two function

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

and

plot_graph_folium(gdf_edges, graph_map=None, popup_attribute=None,

tiles='cartodbpositron', zoom=1, fit_bounds=True,

edge_width=5, edge_opacity=1)

The final result is achieved:

342a14643d4b178fe646c005a248b7c1.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值