
Last chance! 50% off unlimited learning
Sale ends in
Retrieve Hydrologic Unit Code (HUC) data
process_huc(
path,
layer_name = NULL,
huc_level = NULL,
huc_header = NULL,
extent = NULL,
...
)
a SpatVector
object
character. Path to the file or the directory containing HUC data.
character(1). Layer name in the path
character(1). Field name of HUC level
character(1). The upper level HUC code header to extract lower level HUCs.
numeric(4) or SpatExtent giving the extent of the raster
if NULL
(default), the entire raster is loaded
Arguments passed to nhdplusTools::get_huc()
Insang Song
nhdplusTools::get_huc
## NOTE: Examples are wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
if (FALSE) {
library(terra)
getf <- "WBD_National_GDB.gdb"
# check the layer name to read
terra::vector_layers(getf)
test1 <- process_huc(
getf,
layer_name = "WBDHU8",
huc_level = "huc8"
)
test2 <- process_huc(
getf,
layer_name = "WBDHU8",
huc_level = "huc8"
)
test3 <- process_huc(
"",
layer_name = NULL,
huc_level = NULL,
huc_header = NULL,
id = "030202",
type = "huc06"
)
}
Run the code above in your browser using DataLab