ox.shortest_path allows me to find a route that minimizes travel time. However, the aggregate travel time as computed in this osmnx example (https://github.com/gboeing/osmnx-examples/blob/main/notebooks/02-routing-speed-time.ipynb) only computes travel time on the edge, without considering waiting time in front of traffic lights:
Ox.Shorest_Path允许我找到一条最大限度地减少旅行时间的路线。然而,在此osmnx示例中计算的总出行时间(https://github.com/gboeing/osmnx-examples/blob/main/notebooks/02-routing-speed-time.ipynb)仅计算边缘的出行时间,而不考虑红绿灯前的等待时间:
# compare the two routes
route1_length = int(sum(ox.utils_graph.route_to_gdf(G, route1, "length")["length"]))
route2_length = int(sum(ox.utils_graph.route_to_gdf(G, route2, "length")["length"]))
route1_time = int(sum(ox.utils_graph.route_to_gdf(G, route1, "travel_time")["travel_time"]))
route2_time = int(sum(ox.utils_graph.route_to_gdf(G, route2, "travel_time")["travel_time"]))
print("Route 1 is", route1_length, "meters and takes", route1_time, "seconds.")
print("Route 2 is", route2_length, "meters and takes", route2_time, "seconds.")
The "highway" tag for nodes lists if there are traffic signals (i.e. "traffic_signals"). I think I can probably find out how many nodes on the route have traffic_signals, and maybe assume the wait time for each traffic signal is 20 seconds.
节点的“高速公路”标签列出了是否有交通信号(即“TRAFFORM_SIGNAS”)。我想我大概可以找出路线上有多少个节点有交通信号,并假设每个交通信号的等待时间是20秒。
Are there better ways to estimate routing time while taking into account the waiting time in front of a signal?
有没有更好的方法来估计路线时间,同时考虑到信号灯前的等待时间?
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!