make_edges_directed: Convert undirected edges into directed edges based on their...

View source: R/edge.R

make_edges_directedR Documentation

Convert undirected edges into directed edges based on their geometries

Description

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.

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.

Value

A directed network as object of class sfnetwork.

Note

If the network is already directed it is returned unmodified.


luukvdmeer/sfnetworks documentation built on Nov. 21, 2024, 4:54 a.m.