Create a simple features data frame for USGS watershed boundaries
convertWBDHUC(
gdbDir = "~/Data/WBD/WBD_National_GDB.gdb",
level = 2,
simplify = TRUE
)Name of the datasetName being created.
Directory containing the geodatabase.
Character or integer which must be 2, 4, 6, 8, 10, 12 or 14.
Logical specifying whether to perform simplification
A USGS Watershed Boundary Dataset geodatabase is converted to a
simple features data frame with additional columns of data. To use this
function, the WBD geodatabase must be downloaded into a directory which is
identified with gdbDir. The resulting file will be created in the
spatial data directory which is set with setSpatialDataDir().
The full WBD datasetName can be downloaded from the USGS with the following command:
curl https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/WBD/National/GDB/WBD_National_GDB.zip -O
The source data was downloaded on 2023-03-23.
https://www.usgs.gov/national-hydrography/watershed-boundary-dataset
setSpatialDataDir