Match the direction of edge geometries to their specified incident nodes
Source:R/edge.R
make_edges_follow_indices.Rd
This function updates edge geometries in undirected networks such that they are guaranteed to start at their specified *from* node and end at their specified *to* node.
Arguments
- x
An object of class
sfnetwork
.
Value
An object of class sfnetwork
with updated edge
geometries.
Details
In undirected spatial networks it is required that the boundary of edge geometries contain their incident node geometries. However, it is not required that their start point equals their specified *from* node and their end point their specified *to* node. Instead, it may be vice versa. This is because for undirected networks *from* and *to* indices are always swopped if the *to* index is lower than the *from* index.
This function reverses edge geometries if they start at the *to* node and end at the *from* node, such that in the resulting network it is guaranteed that edge boundary points exactly match their incident node geometries. In directed networks, there will be no change.