Skip to contents

This function converts an undirected network to a directed network following the direction given by the linestring geometries of the edges.

Usage

make_edges_directed(x)

Arguments

x

An object of class sfnetwork.

Value

A directed network as object of class sfnetwork.

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. Therefore, the direction given by the *from* and *to* indices does not necessarily match the direction given by the edge geometries.

Note

If the network is already directed it is returned unmodified.