Learn R Programming

MazamaSpatialUtils (version 0.8.6)

convertWBDHUC: Convert USGS hydrologic unit geodatabase

Description

Create a simple features data frame for USGS watershed boundaries

Usage

convertWBDHUC(
  gdbDir = "~/Data/WBD/WBD_National_GDB.gdb",
  level = 2,
  simplify = TRUE
)

Value

Name of the datasetName being created.

Arguments

gdbDir

Directory containing the geodatabase.

level

Character or integer which must be 2, 4, 6, 8, 10, 12 or 14.

simplify

Logical specifying whether to perform simplification

Details

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.

References

https://www.usgs.gov/national-hydrography/watershed-boundary-dataset

See Also

setSpatialDataDir