Simplify a channel object by removing bifurcations and merging spatial objects and removing bifurcations
simplify_channel(chn, simplify_length = 100, verbose = FALSE)Analysis is carriend out in the folowing order - Bifurcations are removed by leaving only the longest link from the node - Removing nodes nodes with a single input and output by merging adjacent river sections to get length > simplify_length
chnFile <- system.file("extdata", "gis", "SwindaleRiverNetwork.gpkg",
package="dynatop", mustWork = TRUE)
chn <- terra::vect(chnFile)
chn$slope <- 1e-3
chn$class <- 1
chn$width <- 1
chn$depth <- 0.1
chn <- convert_channel(chn,
property_names=c(uid = "identifier",
startNode = "startNode",
endNode = "endNode",
slope = "slope",
class = "class",
width="width",
depth="depth"))
tchn <- simplify_channel(chn)
nrow(chn)
#> [1] 19
nrow(tchn)
#> [1] 17