| dodgr_paths_expand | R Documentation |
Paths calculated with dodgr_paths on graphs contracted with dodgr_contract_graph trace and return only the intervening junction vertices. This function expands contracted paths back onto full sequences of edges of original, uncontracted graphs.
dodgr_paths_expand(paths, graph, graph_c, edge_map = NULL)
paths |
A nested list of paths between pairs of (origin, destination)
points, generated by dodgr_paths on a graph previously contracted
with dodgr_contract_graph, so that |
graph |
The full, uncontracted graph from which |
graph_c |
The contracted graph on which |
edge_map |
Optional edge map generated internally by
dodgr_contract_graph, and used to map contracted edges back on to
their corresponding sequences of edges in |
A nested list of the same structure as paths, in which
result [[i]] [[j]] is the expansion of paths [[i]] [[j]] on to the
full, uncontracted sequence of edges of graph, ordered from start to end
of that path. Each expanded path is returned in a form structurally
identical to the corresponding input: a character vector of vertex IDs
from graph if paths [[i]] [[j]] was itself a character vector (that
is, if paths was generated with vertices = TRUE), or an integer vector
of row indices into graph if paths [[i]] [[j]] was an integer vector
(vertices = FALSE). Entries for which the corresponding input path is
NULL or has no transitions are returned as NULL. The result also
carries the same vertices attribute as paths.
Other distances:
dodgr_distances(),
dodgr_dists(),
dodgr_dists_categorical(),
dodgr_dists_nearest(),
dodgr_paths(),
dodgr_times()
graph <- weight_streetnet (hampi)
graph_c <- dodgr_contract_graph (graph)
verts <- dodgr_vertices (graph_c)
from <- verts$id [1]
to <- verts$id [nrow (verts)]
paths_c <- dodgr_paths (graph_c, from = from, to = to)
paths <- dodgr_paths_expand (paths_c, graph, graph_c)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.