SELECTRdata provides convenience functions for downloading raster and tabular data used in the Spatially Explicit Load Enrichment Calculation Tool (SELECT). By providing a SpatRaster object of the target watershed, functions are available to download cropped: - National Land Cover Dataset - FEMA USA Structures - Census Blocks - TIGER County Boundaries - USDA Agricultural Census
Sources to add: - Point sources (via ECHO or echor) - MS4 urbanized areas (via US Census)
You can install the development version of SELECTRdata like so:
# FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE?
library(SELECTRdata)
library(terra)
#> Warning: package 'terra' was built under R version 4.3.3
#> terra 1.7.78
## we need a template file, this is the thomsoncreek watershed in Texas
dem <- system.file("extdata", "thompsoncreek.tif", package = "SELECTRdata")
dem <- terra::rast(dem)
gpkg <- system.file("extdata", "thompsoncreek.gpkg", package = "SELECTRdata")
wbd <- terra::vect(gpkg, layer = "wbd")
dem <- terra::mask(dem, wbd,
filename = tempfile(fileext = ".tif"))
## set the following GDAL options to connect to
## MRLC's AWS S3 bucket
set_gdal_config("AWS_NO_SIGN_REQUEST", "YES")
## download the NLCD file cropped to the extents of the watershed
nlcd <- SELECTRdata::download_nlcd(template = dem,
overwrite = TRUE,
progress = 1)
#> |---------|---------|---------|---------|=========================================
plot(nlcd)
plot(wbd, add = TRUE)
buildings <- download_buildings(template = dem)
plot(buildings)
cen_blocks <- download_census_blocks(dem, "2020")
plot(cen_blocks, "POP100")
counties <- download_counties(dem)
plot(counties)
You’ll still need to render README.Rmd
regularly, to keep README.md
up-to-date. devtools::build_readme()
is handy for this.