Learn R Programming

rcrisp (version 0.3.1)

clean_network: 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)

Value

A cleaned network object of class sfnetworks::sfnetwork

Arguments

network

A network object of class sfnetworks::sfnetwork

simplify

Whether the network should be simplified with simplify_network()

Examples

Run this code
if (FALSE) { # interactive()
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)
}

Run the code above in your browser using DataLab