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
259 stars 84 forks source link

readWQPdata: WQP query by bounding box down #574

Closed jbousquin closed 2 years ago

jbousquin commented 3 years ago

This is a WQP issue not a dataRetrieval issue but posting to document and to see if anyone has a more elegant work-around?

readWQPdata retrieves data from https://www.waterqualitydata.us simplifying the example bBox code from line 100 (part of doc but not test):

pHData_summary <- readWQPdata(bBox=c(-90.10,42.67,-88.64,43.35),
                              characteristicName="pH")

returns a 500 error.

After contacting the WQX team they let me know a recent cloud patch introduced an issue for bounding box queries. They're working on fixing it but it's been a couple months. Other WQP queries work fine, so my solution was using a point location between min/max x and y (note within units=miles):

pHData_summary <- readWQPdata(within=81,
                              lat=43.01,
                              long=-89.37,
                              characteristicName="pH")

My specific use case - I'm retrieving data within a coastal polygon that extends outside nldi catchments so I query by bounding box and then clip results to my geometry. The extra results from the circle query rather than a box just get clipped out either way.

ldecicco-USGS commented 3 years ago

Ha, I like your work-around (MUCH better than mine which was finding the states that my bounding box was within). I've reached out as well to find out when they expect to get the bBox working again.

ldecicco-USGS commented 2 years ago

@jbousquin ... I know it's been a long time coming, but the Water Quality Portal finally was able to fix the bounding box issue!

I've tested it on my end and it works. Feel free to re-open this issue if you find you still have problems. Thanks for your patience!