| ox_distance_matrix | R Documentation |
Computes the matrix of minimum-weight distances between every from node and
every to node (Rust core; one Dijkstra per source).
ox_distance_matrix(g, from, to = from, weight = "length")
g |
An osm_graph. |
from |
Node |
to |
Node |
weight |
Edge column used as weight. Default |
A numeric matrix (length(from) x length(to)) with osmid
dimnames; Inf marks unreachable pairs.
g <- example_osm_graph(n = 3)
nodes <- g$nodes$osmid
ox_distance_matrix(g, from = nodes[1:2], to = nodes[3:4])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.