enforce_dendritic: Enforce dendritic river topology

View source: R/enforce_dendritic.R

enforce_dendriticR Documentation

Enforce dendritic river topology

Description

This function provides an interface to tools which can correct non-dendritic geometries in a river network. This tool can correct divergent rivers and complex confluences.

Usage

enforce_dendritic(rivers, correct = FALSE)

Arguments

rivers

A rivers object returned by import_rivers.

correct

A logical value, when FALSE, the default, corrections are not automatically applied and a sf object of lines is returned with topological errors indicated. If TRUE errors are automatically corrected.

Details

Divergent rivers are parts of a river network where a single tributary splits into two after a confluence. In a dendritic network small upstream rivers can only combine at confluences into a single river.

Complex confluences occur when confluences have over 2 input tributaries. In a dendritic network two tributaries only must combine into one at confluences.

If errors are being corrected manually, all divergent pairs must be reduced to only one river and complex confluences modified such that only 2 rivers join together. When corrections are done automatically the shorted divergent stream is kept.

Value

If correct is FALSE, a sf object with non-dendritic topology indicated in columns "divergent" and "complex". These error columns indicate for each river line if that river is part of a divergent pair or complex confluence. The columns are populated by integers which indicate with which river they share a topological error. If correct is TRUE, a rivers object with automatic topological corrections applied is returned.

Examples

## Not run: 
enforce_dendritic(rivers = sf_line_object)
enforce_dendritic(rivers = sf_line_object, correct = TRUE)

## End(Not run)

aarkilanian/dci documentation built on Feb. 5, 2024, 7:12 p.m.