Skip to content

Commit

Permalink
gwlevel changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ldecicco-USGS committed Jul 29, 2024
1 parent a727a53 commit c0185af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
20 changes: 12 additions & 8 deletions R/readNWISdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@
#' seriesCatalogOutput = TRUE
#' )
#'
#' levels <- readNWISdata(state_cd = "WI",
#' levels <- readNWISdata(stateCd = "WI",
#' service = "gwlevels",
#' begin_date = "2024-05-01",
#' end_date = "2024-05-30",
#' list_of_search_criteria = "state_cd")
#' startDate = "2024-05-01",
#' endDate = "2024-05-30")
#'
#'
#' meas <- readNWISdata(
Expand Down Expand Up @@ -479,11 +478,12 @@ readNWISdots <- function(...) {
}
}

if (service %in% c("peak", "qwdata", "measurements")) {
if (service %in% c("peak", "qwdata", "measurements", "gwlevels")) {
format.default <- "rdb"

names(values)[names(values) == "startDT"] <- "begin_date"
names(values)[names(values) == "endDT"] <- "end_date"
names(values)[names(values) == "sites"] <- "site_no"

if ("bBox" %in% names(values)) {
values["nw_longitude_va"] <- as.character(matchReturn$bBox[1])
Expand All @@ -507,18 +507,22 @@ readNWISdots <- function(...) {
}
}

if (service == "peak" && "state_cd" %in% names(values)) {
if (service %in% c("peak", "gwlevels") && "state_cd" %in% names(values)) {
values["list_of_search_criteria"] <- "state_cd"
}

if (service == "peak" && "huc2_cd" %in% names(values)) {
if (service%in% c("peak", "gwlevels") && "huc2_cd" %in% names(values)) {
values["list_of_search_criteria"] <- "huc2_cd"
}

if (service == "peak" && "bBox" %in% names(values)) {
if (service %in% c("peak", "gwlevels") && "bBox" %in% names(values)) {
values["list_of_search_criteria"] <- "lat_long_bounding_box"
}

if (service == "gwlevels" && "aquiferCd" %in% names(values)) {
values["aquiferCd"] <- "nat_aqfr_cd"
}

if (service %in% c("site", "gwlevels", "stat", "rating", "peak")) {
format.default <- "rdb"
}
Expand Down
7 changes: 3 additions & 4 deletions man/readNWISdata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0185af

Please sign in to comment.