clean_network: Clean a spatial network.

View source: R/network.R

clean_networkR Documentation

Clean a spatial network.

Description

Subdivide edges by adding missing nodes, (optionally) simplify the network (see simplify_network()), remove pseudo-nodes, and discard all but the main connected component.

Usage

clean_network(network, simplify = TRUE)

Arguments

network

A network object

simplify

Whether the network should be simplified with simplify_network()

Value

A cleaned network object

Examples


bucharest_osm <- get_osm_example_data()
edges <- dplyr::bind_rows(bucharest_osm$streets,
                          bucharest_osm$railways)
network <- sfnetworks::as_sfnetwork(edges, directed = FALSE)
clean_network(network)


rcrisp documentation built on Aug. 8, 2025, 6:42 p.m.