| get_huc | R Documentation |
Subsets WBD features by location (POINT), area (POLYGON), or set of HUC IDs.
get_huc(AOI = NULL, id = NULL, t_srs = NULL, buffer = 0.5, type = NULL)
AOI |
sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System. |
id |
WBD HUC ID(s) |
t_srs |
character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests. |
buffer |
numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5 |
type |
character. Type of feature to return. If 'NULL' (default) and 'id' is provided, the HUC level is autodetected from the character length of the IDs (e.g. 2-character IDs → 'huc02', 12-character → 'huc12'). A version suffix alone (e.g. '"_2020"', '"_nhdplusv2"') can also be provided to combine autodetected HUC level with a specific version. If 'NULL' and no 'id' is provided, defaults to 'huc12'. Bare types ('huc02'-'huc12') default to the 2025 WBD version. Versioned types are also available with suffixes '_2025', '_2020', '_nhdplusv2', and '_nhdplushr' (e.g. 'huc12_nhdplusv2'). See https://api.water.usgs.gov/fabric/pygeoapi for the web service. |
The returned object(s) will have the same
Spatial Reference System (SRS) as the input AOI. If a individual or set of
IDs are used to query, then the default server CRS of EPSG:4326 is
preserved. In all cases, a user-defined SRS can be passed to t_srs
which will override all previous SRS (either input or default).
All buffer and distance operations are handled internally using an
EPSG:5070 Albers Equal Area projection
a simple features (sf) object, or a data.frame when
skip_geometry = TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.