R/compute_area_weights.R
compute_area_weights.Rd
Computes weights for each individual river segment specific catchments
falling in the areal units of the runoff HS. Function first
takes a union between basins and HS (creating new
catchment units which fall inside only one runoff unit), and calculating
the area for each individual catchment unit. The weight is assigned by
dividing the area of sub-catchment with the area of runoff unit.
This function is called by compute_HSweights
.
compute_area_weights( basins, HS, pycno = NULL, dasy = NULL, weights = NULL, n = 20, intensive = TRUE, riverID = "riverID", zoneID = "zoneID" )
basins | An 'sf' polygon feature specifying the river segment specific catchments. |
---|---|
HS | A 'HS' object, obtained with |
pycno | Name of Pycnophylactic variable in |
dasy | Name of Dasymetric variable in |
weights | Name of a 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). |
riverID | Column in |
zoneID | Column in |
Returns an 'sf' polygon feature (a union of basins, and HS) with added attributes (columns):
ID. Unique ID of the feature.
riverID. ID of the river segment each sub-catchment is associated to.
zoneID. ID of the runoff unit the sub-catchment is contained in.
weights. Weights computed for each sub-catchment.
target_area. Area of the sub-catchment (basin) in \(m^2\).
source_area. Area of the runoff unit sub-catchment is contained in.