有没有办法在OSMnx中获得20或30 km/h的限速道路和行人专用道路?

2024-09-30 20:17:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图获得给定城市中所有可步行街道的长度(以m为单位)和表面(以平方米为单位),例如巴黎。从文档中,我找到了以平方米为单位的所有可步行街道的面积代码

  1. 我怎么知道除了所有人行道外,是否还包括“步行街”
  2. 此外,是否有办法(与第1点分开)到达交通限制在20或30 km/h的区域/街道

下面是文档中的代码,显示了巴黎所有可步行街道的表面和长度

# 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

Tags: the代码in文档单位areanetworkall
1条回答
网友
1楼 · 发布于 2024-09-30 20:17:12

How can I know if "pedestrian only" streets are also included in this, apart from all pavements?

我建议您熟悉OSM的标记,包括如何处理pedestrian相关数据。然后,您可以轻松地检查图形,或将其转换为GeoDataFrame,或通过某些键:值标记对过滤其节点/边

Also, is there a way to (separately from point 1.) get the zones/ streets where traffic is limited to 20 or 30 km/h?

对。如果OSM中存在给定边缘的max speed数据,您将在边缘的maxspeed属性中找到它。可以按这些属性值进行筛选

相关问题 更多 >