度连通性不一致

时间:2019-10-02 06:42:04

标签: python networkx osmnx

我已经计算出街道网络的连接度。但是结果不一致,即具有相同连接数(在视觉上)的街道无法获得相同的价值。 Degree centrality visualisation for the grid

import Osmnx as ox
import networkx as nx
G = ox.graph_from_place('Glasgow' , which_result = 2)
dc = nx.degree.connectivity(nx.line_graph(G))
nx.save_edge_attirbutes(G, dc,'dc')
ox.save_graph_shapefile(G, filename='City Centre', folder='/users/mohammad/downloads')

通过肉眼检查结果,我认为这与街道的方向有关。我只是想确认一下,或者我是否想念任何东西。

Degree centrality with OSM as a basemap

更新

我尝试使用nx.degree(G)进行计算仍然得出不一致的结果。在此网格图像中,在中间,我应该主要得到4,因为在此相交处四个边缘相交。任何解释/解决方案? Degree using nx.degree function

0 个答案:

没有答案