View source: R/downloading_tools.R
download_nhdplushr | R Documentation |
Download NHDPlus HiRes
download_nhdplushr(nhd_dir, hu_list, download_files = TRUE, archive = FALSE)
nhd_dir |
character directory to save output into |
hu_list |
character vector of hydrologic region(s) to download. Use get_huc to find HU codes of interest. Accepts two digit and four digit codes. |
download_files |
boolean if FALSE, only URLs to files will be returned can be hu02s and/or hu04s |
archive |
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.
hu <- get_huc(sf::st_sfc(sf::st_point(c(-73, 42)), crs = 4326),
type = "huc08")
if(inherits(hu, "sf")) {
(hu <- substr(hu$huc8, 1, 2))
download_nhdplushr(tempdir(), c(hu, "0203"), download_files = FALSE)
download_nhdplushr(tempdir(), c(hu, "0203"), download_files = FALSE, archive = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.