The dodgr
package is designed for routing
on directed graphs, and is known for its fast computations of cost matrices,
shortest paths, and more. In sfnetwork, dodgr can be chosen as a routing
backend.
Usage
dodgr_to_sfnetwork(x, edges_as_lines = TRUE)
sfnetwork_to_dodgr(x, weights = edge_length(), time = FALSE)
Arguments
- x
For the conversion to sfnetwork: an object of class
dodgr_streetnet
. For the conversion from sfnetwork: an object of classsfnetwork
.- edges_as_lines
Should the created edges be spatially explicit, i.e. have
LINESTRING
geometries stored in a geometry list column? Defaults toTRUE
.- weights
The edge weights to be stored in the dodgr streetnet. Evaluated by
evaluate_weight_spec
. The default isedge_length
, which computes the geographic lengths of the edges. Dual-weights can be provided throughdual_weights
.- time
Are the provided weights time values? If
TRUE
, they will be stored in a column named 'time' rather than 'd'. Defaults toFALSE
.
Value
For the conversion to sfnetwork: An object of class
sfnetwork
. For the conversion from sfnetwork: an object of
class dodgr_streetnet
.