DOI-USGS / dataRetrieval

This R package is designed to obtain USGS or EPA water quality sample data, streamflow data, and metadata directly from web services.
https://doi-usgs.github.io/dataRetrieval/
Other
260 stars 84 forks source link

Drainage area retrieval from sites #700

Closed Katianagr closed 6 months ago

Katianagr commented 6 months ago

Is there a way to extract the drainage area of multiple stream sites?

I extracted all of the Puerto Rico active stream sites using the readNWISdata and this gave me a full list along with their coordinate information. I am trying to see if there is a way to get the drainage area corresponding to each site since there are a lot. This is the code I have so far: USGS_PR_COORDS <- readNWISdata(stateCd = "pr", siteStatus = "active", siteType = "ST", hasDataTypeCd = "dv", service="site")

lstanish-usgs commented 6 months ago

Hello @Katianagr, There is an argument - called siteOutput - for readNWISdata(). Set that to "expanded" and the function will retrieve drainage areas along with a bunch of other site metadata: USGS_PR_COORDS <- readNWISdata(stateCd = "pr", siteStatus = "active", siteType = "ST", hasDataTypeCd = "dv", service="site", siteOutput="expanded") Hopefully that gets you what you need.