NHDPlus data provides the most comprehensive and high-resolution hydrography data. This function downloads national dataset from NHDPlus Version 2.1 on USGS Amazon S3 storage.
Arguments
- region
character(1). One of
c("Lower48", "Islands")
. When"Islands"
is selected, the data will be downloaded for Hawaii, Puerto Rico, and Virgin Islands.- type
character(1). One of
c("Seamless", "OceanCatchment")
.- directory_to_save
character(1). Directory to download files.
- acknowledgement
logical(1). By setting
TRUE
the user acknowledges that the data downloaded using this function may be very large and use lots of machine storage and memory.- download
logical(1).
FALSE
will generate a *.txt file containing all download commands. By settingTRUE
the function will download all of the requested data files.- remove_command
logical(1). Remove (
TRUE
) or keep (FALSE
) the text file containing download commands.- unzip
logical(1). Unzip the downloaded compressed files. Default is
FALSE
. Not working for this function since HUC data is in 7z format.- hash
logical(1). By setting
TRUE
the function will return anrlang::hash_file()
hash character corresponding to the downloaded files. Default isFALSE
.
Value
For
hash = FALSE
, NULLFor
hash = TRUE
, anrlang::hash_file
character.Downloaded files will be stored in
directory_to_save
.
Note
For HUC, set type = "Seamless"
. HUC12 layer presents in the seamless
geodatabase. Users can aggregate HUC12 layer to make HUC6, HUC8, HUC10, etc.
For whom wants to download a specific region,
please visit Get NHDPlus Data
Examples
if (FALSE) { # \dontrun{
download_huc(
region = "Lower48",
type = "Seamless",
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE,
unzip = FALSE
)
} # }