Skip to contents

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.

Usage

make_edges_follow_indices(x)

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.