| ox_add_edge_travel_times | R Documentation |
Adds a travel_time edge column (in seconds) from edge length (metres) and
speed_kph. Speeds are added with ox_add_edge_speeds() first if missing.
The resulting column can be used as a routing weight for time-based
shortest paths and isochrones.
ox_add_edge_travel_times(g)
g |
An osm_graph. |
The osm_graph with speed_kph and travel_time
edge columns.
g <- example_osm_graph()
g <- ox_add_edge_travel_times(g)
from <- ox_nearest_nodes(g, 0, 0)
to <- ox_nearest_nodes(g, 300, 300)
ox_shortest_path(g, from, to, weight = "travel_time")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.