This function is not meant to be called directly, but used inside other functions that accept the specification of edge weights.
Details
There are multiple ways in which edge weights can be specified in sfnetworks. The specification can be formatted as follows:
As edge measure function: A spatial edge measure function computes a given measure for each edge, which will then be used as edge weights.
As column name: A column in the edges table of the network that contains the edge weights. Note that tidy evaluation is used and hence the column name should be unquoted.
As a numeric vector: This vector should be of the same length as the number of edges in the network, specifying for each edge what its weight is.
As dual weights: Dual weights can be specified by the
dual_weights
function. This allows to use a different set of weights for shortest paths computation and for reporting the total cost of those paths. Note that not every routing backend support dual-weighted routing.
If the weight specification is NULL
or NA
, this means that no
edge weights are used. For shortest path computation, this means that the
shortest path is simply the path with the fewest number of edges.