R/compute_river_weights.R
compute_river_weights.Rd
Computes weights for each individual river segments falling in the
areal units of the runoff HS. Weight is computed from a
numerical property of segments by x/sum(x) where x are the
river segments contained in a areal unit of runoff (HS).
This function is called by compute_HSweights
.
compute_river_weights( river, grid, seg_weights = NULL, riverID = "riverID", split = TRUE )
river | An 'sf' linestring feature representing a river network. |
---|---|
grid | A |
seg_weights | A character vector specifying type of weights, or a numerical vector. See Details. Defaults to "length". |
riverID | A character string which specifies the name of the column in
|
split | Whether or not to use |
Returns an 'sf' linestring object with attributes:
ID. Unique ID of the feature.
riverID. ID of the river each segment is associated to.
zoneID. ID of the runoff unit the river segment is contained in.
weights. Weights computed for each river segment.
seg_weights should be one of the following: "equal", "length", "strahler", or a numeric vector which specifies the weight for each river segment.
equal option assigns equal weights to all river segments within a runoff unit.
length option weights river segments within a runoff unit 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.