| ox_shortest_path | R Documentation |
Computes the minimum-weight path from from to to using Dijkstra's
algorithm in the Rust core.
ox_shortest_path(g, from, to, weight = "length")
g |
An osm_graph. |
from, to |
Node |
weight |
Edge column used as weight. Default |
A vector of node osmids describing the path (length 0 if the
target is unreachable).
g <- example_osm_graph()
from <- ox_nearest_nodes(g, 0, 0)
to <- ox_nearest_nodes(g, 300, 300)
ox_shortest_path(g, from, to)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.