View source: R/geometrical_functions_sf.R
simplify_network | R Documentation |
Simplify a network by applying two corrections: Healing edges and Removing mirror edges (experimental).
simplify_network(
lines,
digits = 3,
heal = TRUE,
mirror = TRUE,
keep_shortest = TRUE,
verbose = TRUE
)
lines |
A feature collection of linestrings |
digits |
An integer indicating the number of digits to keep in coordinates |
heal |
A boolean indicating if the healing operation must be performed |
mirror |
A boolean indicating if the mirror edges must be removed |
keep_shortest |
A boolean, if TRUE, then the shortest line is kept from mirror edges. if FALSE, then the longest line is kept. |
verbose |
A boolean indicating if messages and a progress bar should be displayed |
Healing is the operation to merge two connected linestring if the are intersecting at one extremity and do not intersect any other linestring. It helps to reduce the complexity of the network and thus can reduce calculation time. Removing mirror edges is the operation to remove edges that have the same extremities. If two edges start at the same point and end at the same point, they do not add information in the network and one can be removed to simplify the network. One can decide to keep the longest of the two edges or the shortest. NOTE: the edge healing does not consider lines directions currently!
A feature collection of linestrings
data(mtl_network)
edited_lines <- simplify_network(mtl_network, digits = 3, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.