graph_checking: Topological error

View source: R/graph_functions_sf.R

graph_checkingR Documentation

Topological error

Description

A utility function to find topological errors in a network.

Usage

graph_checking(lines, digits, max_search = 5, tol = 0.1)

Arguments

lines

A feature collection of linestrings representing the network

digits

An integer indicating the number of digits to retain for coordinates

max_search

The maximum number of nearest neighbour to search to find close_nodes

tol

The minimum distance expected between two nodes. If two nodes are closer, they are returned in the result of the function.

Details

This function can be used to check for three common problems in networks: disconnected components, dangle nodes and close nodes. When a network has disconnected components, this means that several unconnected graphs are composing the overall network. This can be caused by topological errors in the dataset. Dangle nodes are nodes connected to only one other node. This type of node can be normal at the border of a network, but can also be caused by topological errors. Close nodes are nodes that are not coincident, but so close that they probably should be coincident.

Value

A list with three elements. The first is a feature collection of points indicating for each node of the network to which component it belongs. The second is a feature collection of points with nodes that are too close one of each other. The third is a feature collection of points with the dangle nodes of the network.

Examples


data(mtl_netowrk)
topo_errors <- graph_checking(mtl_network, 2)


JeremyGelb/spNetwork documentation built on May 24, 2024, 7:23 p.m.