river_net: Create a 'river_net' Object

View source: R/river_net.R

river_netR Documentation

Create a river_net Object

Description

Constructs a river_net object, a geospatial network structure built on top of the sfnetworks::sfnetwork() class. This object integrates river lines, barriers and outlets allowing for connectivity analyses with calculate_dci() or other network tools.

Usage

river_net(
  rivers,
  barriers,
  outlet,
  check = TRUE,
  tolerance = NULL,
  max_iter = 10
)

Arguments

rivers

A rivers object returned by import_rivers().

barriers

A barriers object returned by import_points() with type = "bars".

outlet

An outlet object returned by import_points() with type = "out".

check

Logical. If TRUE (default), dendritic topology is enforced using enforce_dendritic().

tolerance

A numeric value specifying the snapping distance (in map units) to align points to the river network. Defaults to NULL, meaning no snapping.

max_iter

An integer indicating the maximum number of correction iterations to run. As some topological errors are corrected new ones can can arise requiring multiple passes. In some cases, an automated correction choice can lead to a recursive correction that eliminates most rivers. In this case, some manual corrections may help avoid this.

Value

An object of class river_net representing the river network formed from the provided spatial inputs.

Examples

riv_in <- import_rivers(yamaska_rivers, quiet = TRUE)
bar_in <- import_points(yamaska_barriers, type = "bars")
out_in <- import_points(yamaska_outlet, type = "out")

# For large river networks it may be better to specify a smaller number of
# correction sweeps.
yam_net <- river_net(rivers = riv_in, barriers = bar_in,
outlet = out_in, max_iter = 3)

dci documentation built on June 14, 2025, 1:08 a.m.