HSweights
from HS
and a river network
The function computes weights either based on catchment areas (polygons),
or line segments which intersect a polygon with runoff information. Weights
are assigned so that the sum of weights for area or line features within a
polygon equal to 1.R/compute_weights.R
compute_HSweights.Rd
The river network needs to be a "clean", connected network. This means that connected river segments share a node at the point of confluence, and all linestrings are cut at segment intersections.
compute_HSweights( HS, river, basins = NULL, dasymetric = NULL, pycnophylactic = NULL, n = 20, intensive = TRUE, weights = NULL, aoi = NULL, riverID = "riverID", verbose = FALSE )
HS | A 'HS' object, obtained with |
---|---|
river | An 'sf' linestring feature representing a river network. |
basins | An 'sf' polygon object. If weights are set to "area", providing
basins skips the delineation process. ID column must have the name as
|
dasymetric | Column name in |
pycnophylactic | Column in |
n | Number of iterations when using pycnophylactic interpolation.
Default |
intensive | Whether the pycnophylactic variable is intensive (density, like runoff in mm), or not (in which case it is extensive, or counts like runoff in volume). |
weights | Name of a column in |
aoi | An area of interest ('sf' polygon object) used to intersect
|
riverID | A character string which specifies the name of the column in
|
verbose | Whether or not print progress indicators. |
Returns a list object with class 'HSweights', containing the following elements:
river
. The supplied river network with routing information.
See river_network
for details.
weights
. River network lines or catchment polygon network
which was used as the basis of weighting. See
compute_area_weights
or compute_river_weights
for details.
HS
. The input HS object containing runoff information.
Weights should be one of the following: "equal", "length", "strahler", "area", or a numeric vector which specifies the weight for each river segment.
equal
option assigns equal weights to all river segments within
a polygon.
length
option weights river segments within a polygon based on
the length of the segment.
strahler
option weights river segments based on the Strahler
number computed for the
supplied river network.
A numeric vector with length equal to the number of features in
river
. Weights will be computed within a polygon: \(x_i/sum(x)\)
area
option weights the river segments based on segment-specific
catchment area falling inside a polygon. See more details below.
If line-based weights (equal, length, strahler, user specified vector) are used, the river network is split at grid cell boundaries before determining polygon-segment relationship.
"area" weights can be used when catchment-based weighting is desired. If no
further data is supplied, the function computes a Voronoi diagram from the
river network (see river_voronoi
for details). If the basins
are known, they can be supplied which allows skipping the delineation step
entirely.