Closed fjones2222 closed 1 year ago
The data for the next-gen monitoring location pages is coming from: https://waterwatch.usgs.gov/webservices/
The underlying data for that service comes from "AHPS": https://water.weather.gov/precip/
AHPS are currently talking about updating their services here: https://storymaps.arcgis.com/stories/5b0c7dd5081548d29f04feefddd83104
In the meantime, you could do this:
sites <- c("50138000", "05407000")
get_flood_stage <- function(sites){
base_url <- "https://waterwatch.usgs.gov/webservices/floodstage?site="
df_all <- data.frame()
for(i in sites){ #the service can only take 1 site at a time
full_url <- paste0(base_url, i)
list_return <- jsonlite::fromJSON(full_url)
df_all <- rbind(df_all, list_return[["sites"]])
}
return(df_all)
}
flood_info <- get_flood_stage(sites)
I'm unclear if the waterwatch services are something we can count on long-term, but it currently is the best/easiest way to get flood information from a USGS site ID. Once the AHPS and waterwatch services are updated, we can re-visit if dataRetrieval could hit them directly.
@ldecicco-USGS thank you so much for this as well as making a great package! worked like a charm!
Is it possible to access flood benchmarks/categories from the dataRetrieval package? To be clear, I am referring to section 1 from the link below.
https://waterdata.usgs.gov/blog/5-new-things/
I would have thought that the following code would provide information on the different levels from defining different flood categories for each site.