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
)
A feature collection of linestrings
An integer indicating the number of digits to keep in coordinates
A boolean indicating if the healing operation must be performed
A boolean indicating if the mirror edges must be removed
A boolean, if TRUE, then the shortest line is kept from mirror edges. if FALSE, then the longest line is kept.
A boolean indicating if messages and a progress bar should be displayed
A feature collection of linestrings
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!
# \donttest{
data(mtl_network)
edited_lines <- simplify_network(mtl_network, digits = 3, verbose = FALSE)
# }