Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocean "country" queries not working #424

Open
cristinamullin opened this issue Mar 19, 2024 · 0 comments
Open

Ocean "country" queries not working #424

cristinamullin opened this issue Mar 19, 2024 · 0 comments

Comments

@cristinamullin
Copy link
Collaborator

Describe the bug

I noticed the WQP ocean country queries are not working. Using USGS dataRetrieval in R I received a more helpful error message than when I queried the WQP service directly. The error message that DR reports is that the codes must be in the format [A-Z]{2}, meaning two capital letters. It seems like all the ocean codes won’t work because they include numbers: https://www.waterqualitydata.us/Codes/countrycode

To Reproduce

Code to reproduce the behavior:

library(dataRetrieval)
test = readWQPdata(countrycode = "3M", dataProfile = "resultPhysChem", ignore_attributes = TRUE, startDate = "2013-01-01")

library(TADA)
test = TADA_DataRetrieval(countrycode = "3M", startDate = "2013-01-01")

[1] "Downloading WQP query results. This may take some time depending upon the query size."
Request failed [400]. Retrying in 1 seconds...
Request failed [400]. Retrying in 1.6 seconds...
Bad Request (HTTP 400).299 WQP "The value of countrycode=3M must match the format [A-Z]{2}"
Error in attr(retval, "queryTime") <- Sys.time() : 
  attempt to set an attribute on NULL

Expected behavior

We should be able to query the WQP for ocean data using the country codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant