Skip to content

Commit e86bb6e

Browse files
committed
update for No sites/data found using the selection criteria specified text (not xml)
1 parent 7aec473 commit e86bb6e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

R/getWebServiceData.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ getWebServiceData <- function(obs_url, ...) {
5454
returnedDoc <- httr2::resp_body_string(returnedList)
5555
} else if (content %in% return_readLines) {
5656
returnedList <- httr2::resp_body_string(returnedList)
57-
txt <- readLines(returnedList$content)
58-
message(txt)
59-
return(txt)
57+
message(returnedList)
58+
returnedDoc <- returnedList
6059
} else if (content %in% return_json){
6160
returnedDoc <- httr2::resp_body_json(returnedList)
6261
} else {

tests/testthat/tests_userFriendly_fxns.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ test_that("peak, rating curves, surface-water measurements", {
103103
siteID <- "263819081585801"
104104
gwl_1 <- readNWISgwl(siteID)
105105
expect_equal(unique(gwl_1$site_no), siteID)
106+
107+
# No data:
108+
expect_message(readNWISpeak(stations,
109+
startDate = "2024-08-01",
110+
endDate = "2024-08-31",
111+
convertType = FALSE))
106112
})
107113

108114
test_that("NWIS dv tests", {

vignettes/Status.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ If you have additional questions about the NWIS qw data service, email CompTools
3434
* The output of the "constructURL..." functions are now `httr2` requests instead of a character string.
3535

3636
* The update to `httr2` will give us more flexibility to set up the eventual replacements to the NWIS web services. Over the next year, expect to see some new and major updates to USGS data access. dataRetrieval WILL stay on the cutting edge for accessing new USGS APIs.
37+
3738
* WQP continues to default to the legacy system (that does not include recent USGS discrete sample data). To access the most recent USGS data from the new "WQX3" services use the function `readWQPqw` and set the argument `legacy=FALSE` or use the function `readWQPdata` and set the argument `service = "ResultWQX3"`. Why aren't the new services set as default? This is because the WQP itself still considers those services "beta", and therefore performance is not guaranteed.
3839

3940
* Finally, saving the best for last! There's a new set of functions that access the new USGS "samples-data" services. This is a USGS-specific service for discrete sample data. If you are only interested in USGS discrete water quality data (as opposed to USGS AND non-USGS discrete water quality data available from Water Quality Portal), you can use the `read_USGS_samples` function.

0 commit comments

Comments
 (0)