我试图获得给定城市中所有可步行街道的长度(以m为单位)和表面(以平方米为单位),例如巴黎。从文档中,我找到了以平方米为单位的所有可步行街道的面积代码
下面是文档中的代码,显示了巴黎所有可步行街道的表面和长度
# Get the network graph for all streets and paths that pedestrians can use
G = ox.graph_from_place('Paris, France', network_type='walk')
fig, ax = ox.plot_graph(G, node_size=0, bgcolor='k')
# what sized area does our network cover in square meters?
G_proj = ox.project_graph(G)
nodes_proj = ox.graph_to_gdfs(G_proj, edges=False)
graph_area_m = nodes_proj.unary_union.convex_hull.area
graph_area_m
# show some basic stats about the network, "street_length_total" shows the length of all streets in the upper graph
ox.basic_stats(G_proj, area=graph_area_m, clean_intersects=True, circuity_dist='euclidean')
# street_length_total = sum of all edges in the undirected
我建议您熟悉OSM的标记,包括如何处理pedestrian相关数据。然后,您可以轻松地检查图形,或将其转换为GeoDataFrame,或通过某些键:值标记对过滤其节点/边
对。如果OSM中存在给定边缘的max speed数据,您将在边缘的
maxspeed
属性中找到它。可以按这些属性值进行筛选相关问题 更多 >
编程相关推荐