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

Is there a way to get 20 or 30 km/ h speed limit roads and pedestrian only roads in OSMnx?

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

  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

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

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

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 属性中找到它。您可以按这些属性值进行过滤。