Download NHDPlus HiRes
download_nhdplushr(nhd_dir, hu_list, download_files = TRUE, archive = FALSE)
character directory to save output into
character vector of hydrologic region(s) to download. Use get_huc to find HU codes of interest. Accepts two digit and four digit codes.
boolean if FALSE, only URLs to files will be returned can be hu02s and/or hu04s
pull data from the "archive" folder rather than "current". The archive contains the original releases of NHDPlusHR data that were updated in subsequent processing. Not all subsets of NHDPlusHR were updated. See: https://www.usgs.gov/national-hydrography/access-national-hydrography-products for more details.
character Paths to geodatabases created.
# \donttest{
hu <- get_huc(sf::st_sfc(sf::st_point(c(-73, 42)), crs = 4326),
type = "huc08")
#> Spherical geometry (s2) switched off
#> although coordinates are longitude/latitude, st_intersects assumes that they
#> are planar
#> Spherical geometry (s2) switched on
(hu <- substr(hu$huc8, 1, 2))
#> [1] "01"
download_nhdplushr(tempdir(), c(hu, "0203"), download_files = FALSE)
#> [1] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0101_HU4_20220901_GDB.zip"
#> [2] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0102_HU4_20230713_GDB.zip"
#> [3] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0103_HU4_20230713_GDB.zip"
#> [4] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0104_HU4_20230713_GDB.zip"
#> [5] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0105_HU4_20230713_GDB.zip"
#> [6] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0106_HU4_20230713_GDB.zip"
#> [7] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0107_HU4_20230713_GDB.zip"
#> [8] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0108_HU4_20220324_GDB.zip"
#> [9] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0109_HU4_20230713_GDB.zip"
#> [10] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0110_HU4_20220323_GDB.zip"
#> [11] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0203_HU4_20220323_GDB.zip"
download_nhdplushr(tempdir(), c(hu, "0203"), download_files = FALSE, archive = TRUE)
#> [1] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0101_HU4_GDB.zip"
#> [2] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0102_HU4_GDB.zip"
#> [3] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0103_HU4_GDB.zip"
#> [4] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0104_HU4_GDB.zip"
#> [5] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0105_HU4_GDB.zip"
#> [6] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0106_HU4_GDB.zip"
#> [7] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0107_HU4_GDB.zip"
#> [8] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0108_HU4_GDB.zip"
#> [9] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0109_HU4_GDB.zip"
#> [10] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0110_HU4_GDB.zip"
#> [11] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Archive/GDB/NHDPLUS_H_0203_HU4_GDB.zip"
# }