
Assign Each HUC12 Watershed to Its Dominant WRIA
Source:R/assign_wria_to_huc12.R
assign_wria_to_huc12.RdThis function intersects HUC12 watersheds with Water Resource Inventory Areas (WRIAs) and assigns each HUC12 to the WRIA that overlaps it the most by area. Both input layers are transformed to EPSG:5070 (NAD83 / Conus Albers) for accurate area calculation.
Examples
if (FALSE) { # \dontrun{
huc12_wria_table <- assign_wria_to_huc12(
huc12_sf = huc12_layer,
wria_sf = wria_layer,
huc_id_col = "huc12",
huc_name_col = "name"
)
# Join to spatial layer
huc12_with_wria <- dplyr::left_join(huc12_layer, huc12_wria_table, by = "HUC12")
} # }