Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5242f6b
read_waterdata_field_measurements
ldecicco-USGS Jul 21, 2025
38300d6
bump version
ldecicco-USGS Jul 21, 2025
2c96d87
news
ldecicco-USGS Jul 21, 2025
0feb1fc
don't run donttest examples on GitHub (still getting run on code.usgs…
ldecicco-USGS Jul 22, 2025
faf1892
Add template for future waterdata functions.
ldecicco-USGS Jul 22, 2025
0ecb2f5
add more checkboxes
ldecicco-USGS Jul 22, 2025
2c4b11b
skip all nldi tests on ci
ldecicco-USGS Jul 22, 2025
ba23d81
shouldn't be committing this
ldecicco-USGS Jul 22, 2025
bf6e04f
make a teensy bit more efficient
ldecicco-USGS Jul 23, 2025
ec526e8
add more skips
ldecicco-USGS Jul 23, 2025
9fa93b8
troubleshooting
ldecicco-USGS Jul 23, 2025
404356d
?
ldecicco-USGS Jul 23, 2025
94e6beb
better?
ldecicco-USGS Jul 23, 2025
2e96539
got it?
ldecicco-USGS Jul 23, 2025
7273c3c
Merge pull request #809 from ldecicco-USGS/field_measurements
ldecicco-USGS Jul 28, 2025
ff84b0f
no compress for NWIS?
ldecicco-USGS Jul 28, 2025
da80742
update ts_meta and make sure all tests are skipped on CRAN
ldecicco-USGS Aug 4, 2025
89066b9
Test rejigger
ldecicco-USGS Aug 4, 2025
c866b14
get dataRetrieval?
ldecicco-USGS Aug 4, 2025
cce05b6
test
ldecicco-USGS Aug 4, 2025
478de58
?
ldecicco-USGS Aug 4, 2025
4c3fbbf
??
ldecicco-USGS Aug 4, 2025
69abd05
???
ldecicco-USGS Aug 4, 2025
6858cdd
paths are hard
ldecicco-USGS Aug 4, 2025
38c40ce
quick ci test
ldecicco-USGS Aug 4, 2025
b4710fe
🤞
ldecicco-USGS Aug 4, 2025
1a77133
now github
ldecicco-USGS Aug 5, 2025
cea2af2
Getting docs updated
ldecicco-USGS Aug 5, 2025
c39434f
Fixes #810
ldecicco-USGS Aug 6, 2025
25b794f
?
ldecicco-USGS Aug 6, 2025
c960082
We want this back
ldecicco-USGS Aug 6, 2025
56f9118
Merge pull request #811 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
f55a221
move order
ldecicco-USGS Aug 6, 2025
2fb6b84
?
ldecicco-USGS Aug 6, 2025
ce73b77
?
ldecicco-USGS Aug 6, 2025
6182aac
??
ldecicco-USGS Aug 6, 2025
03a5eb1
???
ldecicco-USGS Aug 6, 2025
72043bf
????
ldecicco-USGS Aug 6, 2025
8776528
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
3e98ff2
Merge pull request #813 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
fc89161
more pkgdown troubleshooting
ldecicco-USGS Aug 6, 2025
af0bbba
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
6569610
Merge pull request #814 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
ad9121b
gh actions
ldecicco-USGS Aug 6, 2025
917201f
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
287563f
Merge pull request #815 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
8ed0e17
use to
ldecicco-USGS Aug 6, 2025
c695abe
Merge pull request #816 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
e38c5ed
😔
ldecicco-USGS Aug 6, 2025
e90343a
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
f6ea581
Merge pull request #817 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
e521f49
?
ldecicco-USGS Aug 6, 2025
bfdfb92
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
18b5c8f
Merge pull request #818 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
c94de42
do it by hand?
ldecicco-USGS Aug 6, 2025
e34a459
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
9e6ce42
Merge pull request #819 from ldecicco-USGS/develop
ldecicco-USGS Aug 6, 2025
8dcc0e2
no idea
ldecicco-USGS Aug 6, 2025
9e3e561
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS Aug 6, 2025
16786cb
?
ldecicco-USGS Aug 6, 2025
1f30d14
will this work on GitLab?
ldecicco-USGS Aug 7, 2025
3d08dae
Merge pull request #820 from ldecicco-USGS/develop
ldecicco-USGS Aug 7, 2025
5af8f80
Update .gitlab/issue_templates/waterdata_additions.md
ldecicco-USGS Aug 14, 2025
25da695
Update tutorials/basic_slides_deck.qmd
ldecicco-USGS Aug 14, 2025
e80a705
Update tutorials/basic_slides_deck.qmd
ldecicco-USGS Aug 14, 2025
b7951d2
Update tutorials/changes_slides_deck.qmd
ldecicco-USGS Aug 14, 2025
3ec5e05
Update tutorials/changes_slides_deck.qmd
ldecicco-USGS Aug 14, 2025
23fe02e
Update tutorials/changes_slides_deck.qmd
ldecicco-USGS Aug 14, 2025
ea1d6d3
Update tutorials/basic_slides_deck.qmd
ldecicco-USGS Aug 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ vignettes/Wide_data_example.xlsx
vignettes/messyData.png
^ci$
^public$
^tutorials$
^docker$
vignettes/WQX_3.Rmd
vignettes/samples_data.Rmd
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
API_USGS_PAT: ${{ secrets.API_USGS_PAT }}
R_KEEP_PKG_SOURCE: yes
CUSTOM_DR_UA: 'GitHub_CI'
_R_CHECK_DONTTEST_EXAMPLES_: false

steps:
- uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ jobs:
any::gridExtra
local::.
needs: website

- name: Create public directory
run: |
mkdir public
- name: Build site
run: |
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, dest_dir = "public") |
pkgdown::build_site(override = list(destination = "public")) |
file.copy(from = "./public/articles/logo.png",to = "./public/reference/logo.png")
shell: Rscript {0}
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ docs
/doc/
/Meta/
/Temp/
vignettes/*.html
vignettes/*.R


/.quarto/
14 changes: 8 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ variables:
_R_CHECK_FORCE_SUGGESTS_: "true"
_R_CHECK_DONTTEST_EXAMPLES_: "false"
R_PROFILE: "$R_HOME/etc/Rprofile.site"
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib"
APT_CACHE: "$CI_PROJECT_DIR/ci/lib/apt-cache"
CRAN: "https://rpkg.chs.usgs.gov/prod-cran/latest"
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib"
R_LIBS: "$CI_PROJECT_DIR/ci/lib"
BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs"
NOT_CRAN: "true"
Expand All @@ -43,7 +43,6 @@ build-image:
rules:
- changes:
- docker/Dockerfile
- .gitlab-ci.yml
script:
- echo ${CI_REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin $CI_REGISTRY
- docker pull ${CI_REGISTRY_IMAGE}:latest || true
Expand All @@ -59,7 +58,7 @@ buildcheck:
dependencies:
- build-image
script:
- R CMD build . --no-manual
- Rscript -e 'devtools::install(quick = TRUE, upgrade = "never")'
- Rscript -e 'devtools::check(document = FALSE, args = "--no-tests", check_dir = Sys.getenv("BUILD_LOGS_DIR"), vignettes = FALSE)'

unittests:
Expand Down Expand Up @@ -97,10 +96,15 @@ longtest:

pages:
stage: end
cache: []
dependencies:
- build-image
- buildcheck
script:
- Rscript -e 'devtools::install(quick = TRUE, upgrade = "never")'
- Rscript -e 'pkgdown::build_site(override = list(destination = "public"))'
- Rscript -e 'file.copy(from = "./public/articles/logo.png", to = "./public/reference/logo.png")'
- quarto render

artifacts:
paths:
- $PAGES_OUTDIR
Expand All @@ -119,5 +123,3 @@ Validate Inventory:
--token "${GIT_TOKEN_CUSTOM}"
tags:
- chs-shared


29 changes: 29 additions & 0 deletions .gitlab/issue_templates/waterdata_additions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: New waterdata function
about: Checklist for adding new USGS waterdata endpoint
---

New features should include all of the following work:

* [ ] Create the `read_waterdata_` file. File should:
- [ ] Update endpoint name
- [ ] Update parameter list in Roxygen section
- [ ] Update arguments
- [ ] Update examples
- [ ] Think about if sorting looks right, if convertType should be used, etc.
* [ ] Add endpoint name to AAA.R `.onLoad`
* [ ] Add deprecate notice to corresponding NWIS function
* [ ] Comment out or delete deprecated NWIS examples
* [ ] Replace any NWIS tests with new waterdata function
* [ ] Create new tests in tests/testthat folder for unique situations
* [ ] Add example to read_waterdata_functions.Rmd vignette
* [ ] Update Status.Rmd vignette
* [ ] Update dataRetrieval.Rmd vignette
* [ ] Update tutorial.Rmd vignette
* [ ] Update NEWS
* [ ] Update _pkgdown.yml
* [ ] Check if README needs to be updated
* [ ] Update version (for development, only bump up last 4 digits)
* [ ] Create PR for "develop" branch on GitHub
* [ ] Create and merge MR for "develop" branch on code.usgs.gov. This will generate development version of documentation.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrology and Water Quality Data
Version: 2.7.20
Version: 2.7.21
Authors@R: c(
person("Laura", "DeCicco", role = c("aut","cre"),
email = "[email protected]",
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export(readWQPsummary)
export(read_USGS_samples)
export(read_waterdata)
export(read_waterdata_daily)
export(read_waterdata_field_measurements)
export(read_waterdata_latest_continuous)
export(read_waterdata_metadata)
export(read_waterdata_monitoring_location)
Expand Down
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
dataRetrieval 2.7.21
===================
* Added read_waterdata_field_measurements to access new USGS water data API.
* Added deprecation warning to readNWISgwl and readNWISmeas.
* Added parent_time_series_id to read_waterdata_ts_meta.
* Updated some documentation.

dataRetrieval 2.7.20
===================
* Added id transformation to read_waterdata to match other functions
Expand Down
3 changes: 2 additions & 1 deletion R/AAA.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ pkg.env <- new.env()
options("dataRetrieval" = list("api_version" = "v0"))

services <- c("server", "daily", "time-series-metadata",
"monitoring-locations", "latest-continuous")
"monitoring-locations", "latest-continuous",
"field-measurements")
collections <- c("parameter-codes", "agency-codes", "altitude-datums", "aquifer-codes",
"aquifer-types", "coordinate-accuracy-codes", "coordinate-datum-codes",
"coordinate-method-codes", "medium-codes",
Expand Down
4 changes: 2 additions & 2 deletions R/constructNWISURL.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ constructNWISURL <- function(siteNumbers,
)

url <- httr2::req_headers(url,
`Accept-Encoding` = c("compress", "gzip", "deflate"))
`Accept-Encoding` = c("compress", "gzip", "deflate"))

return(url)
}
Expand Down Expand Up @@ -426,7 +426,7 @@ constructWQPURL <- function(siteNumbers,
}

baseURL <- httr2::req_headers(baseURL,
`Accept-Encoding` = c("compress", "gzip", "deflate"))
`Accept-Encoding` = c("compress", "gzip", "deflate"))

return(baseURL)
}
Expand Down
19 changes: 12 additions & 7 deletions R/construct_api_requests.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ construct_api_requests <- function(service,
POST = TRUE
}

get_list <- get_list[!is.na(get_list)]

time_periods <- c("last_modified", "datetime", "time", "begin", "end")
if(any(time_periods %in% names(get_list))){

for(i in time_periods){
for(i in time_periods[time_periods %in% names(get_list)]){
dates <- FALSE
if (all(service == "daily" & i != "last_modified")){
dates <- TRUE
Expand Down Expand Up @@ -299,6 +301,7 @@ switch_properties_id <- function(properties, id_name, service){
#'
#' start <- c("2021-01-01", NA)
#' dataRetrieval:::format_api_dates(start)
#' dataRetrieval:::format_api_dates(start, TRUE)
#'
#' end <- c(NA, "2021-01-01")
#' dataRetrieval:::format_api_dates(end)
Expand All @@ -316,10 +319,12 @@ switch_properties_id <- function(properties, id_name, service){
#'
#' dataRetrieval:::format_api_dates(start_end)
#'
#' # If you don't specify a timezone, it will assume UTC
#' start_end2 <- c("2021-01-01 12:15:00", "")
#' dataRetrieval:::format_api_dates(start_end2)
#'
#' start_end2 <- c("2021-01-01T12:15:00Z", "")
#' # If you do specify a timezone, it should maintain it, but convert to UTC:
#' start_end2 <- c("2021-01-01T12:15:00-0500", "")
#' dataRetrieval:::format_api_dates(start_end2)
#'
format_api_dates <- function(datetime, date = FALSE){
Expand All @@ -336,18 +341,18 @@ format_api_dates <- function(datetime, date = FALSE){
return(datetime)
} else {
if(date){
datetime <- format(datetime, "%Y-%m-%d")
datetime <- format(lubridate::as_datetime(datetime), "%Y-%m-%d")
} else {
datetime <- lubridate::format_ISO8601(datetime, usetz = TRUE)
datetime <- lubridate::format_ISO8601(lubridate::as_datetime(datetime), usetz = "Z")
}
}
} else if (length(datetime) == 2) {

if(date){
datetime <- paste0(format(as.Date(datetime), "%Y-%m-%d"), collapse = "/")
datetime <- paste0(format(lubridate::as_datetime(datetime), "%Y-%m-%d"), collapse = "/")
} else {
datetime <- paste0(lubridate::format_ISO8601(as.POSIXct(datetime),
usetz = TRUE),
datetime <- paste0(lubridate::format_ISO8601(lubridate::as_datetime(datetime),
usetz = "Z"),
collapse = "/")
}

Expand Down
2 changes: 1 addition & 1 deletion R/getWebServiceData.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ getWebServiceData <- function(obs_url, ...) {
obs_url <- httr2::req_retry(obs_url,
backoff = ~ 5, max_tries = 3)
obs_url <- httr2::req_headers(obs_url,
`Accept-Encoding` = c("compress", "gzip"))
`Accept-Encoding` = c("compress", "gzip"))

url_method <- "GET"
if(!is.null(obs_url$body)){
Expand Down
2 changes: 1 addition & 1 deletion R/importWaterML1.R
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ check_if_xml <- function(obs_url) {
} else if (inherits(obs_url, c("xml_node", "xml_nodeset"))) {
returnedDoc <- obs_url
} else {
doc <- getWebServiceData(obs_url, encoding = "gzip")
doc <- getWebServiceData(obs_url)
if (is.null(doc)) {
return(invisible(NULL))
}
Expand Down
18 changes: 11 additions & 7 deletions R/readNWISunit.R
Original file line number Diff line number Diff line change
Expand Up @@ -493,23 +493,27 @@ readNWISmeas <- function(siteNumbers,
#' @seealso [constructNWISURL()], [importRDB1()]
#' @export
#' @examplesIf is_dataRetrieval_user()
#' site_id <- "434400121275801"
#' #site_id <- "434400121275801"
#' \donttest{
#' data <- readNWISgwl(site_id)
#' sites <- c("434400121275801", "375907091432201")
#' data2 <- readNWISgwl(sites, "", "")
#' data3 <- readNWISgwl("420125073193001", "", "")
#' #data <- readNWISgwl(site_id)
#' #sites <- c("434400121275801", "375907091432201")
#' #data2 <- readNWISgwl(sites, "", "")
#' #data3 <- readNWISgwl("420125073193001", "", "")
#' # handling of data where date has no day
#' data4 <- readNWISgwl("425957088141001", startDate = "1980-01-01")
#' #data4 <- readNWISgwl("425957088141001", startDate = "1980-01-01")
#'
#' data5 <- readNWISgwl("263819081585801", parameterCd = "72019")
#' #data5 <- readNWISgwl("263819081585801", parameterCd = "72019")
#' }
readNWISgwl <- function(siteNumbers,
startDate = "",
endDate = "",
parameterCd = NA,
convertType = TRUE, tz = "UTC") {

.Deprecated(new = "read_waterdata_field_measurements.",
package = "dataRetrieval",
msg = "NWIS servers are slated for decommission. Please begin to migrate to read_waterdata_field_measurements.")

message(new_nwis_message())

url <- constructNWISURL(
Expand Down
101 changes: 101 additions & 0 deletions R/read_waterdata_field_measurements.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#' Get USGS Field Measurement Water Data
#'
#' @description `r get_description("field-measurements")`
#'
#' @export
#' @param monitoring_location_id `r get_params("field-measurements")$monitoring_location_id`
#' @param parameter_code `r get_params("field-measurements")$parameter_code`
#' @param observing_procedure_code `r get_params("field-measurements")$observing_procedure_code`
#' @param time `r get_params("field-measurements")$time`
#' @param value `r get_params("field-measurements")$value`
#' @param unit_of_measure `r get_params("field-measurements")$unit_of_measure`
#' @param approval_status `r get_params("field-measurements")$approval_status`
#' @param last_modified `r get_params("field-measurements")$last_modified`
#' @param qualifier `r get_params("field-measurements")$qualifier`
#' @param field_visit_id `r get_params("field-measurements")$field_visit_id`
#' @param observing_procedure `r get_params("field-measurements")$observing_procedure`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a set of codes for this. "qualifier" is also quite opaque. In my tests, I see the qualifier "Static" and "".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitate to go off script (all the r get_params("field-measurements")$qualifier generate text about the argument). So, you could bring it up with the API group. But also, I suspect the qualifiers might not be standardized to a small set of options, otherwise they would be available in the read_waterdata_metadata function.

#' @param vertical_datum `r get_params("field-measurements")$vertical_datum`
#' @param measuring_agency `r get_params("field-measurements")$measuring_agency`
#' @param properties A vector of requested columns to be returned from the query.
#' Available options are:
#' `r schema <- check_OGC_requests(endpoint = "field-measurements", type = "schema"); paste(names(schema$properties), collapse = ", ")`
#' @param bbox Only features that have a geometry that intersects the bounding
#' box are selected.The bounding box is provided as four or six numbers, depending
#' on whether the coordinate reference system includes a vertical axis (height or
#' depth). Coordinates are assumed to be in crs 4326. The expected format is a numeric
#' vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude,
#' Southern-most latitude, Eastern-most longitude, Northern-most longitude).
#' @param limit The optional limit parameter is used to control the subset of the
#' selected features that should be returned in each page. The maximum allowable
#' limit is 10000. It may be beneficial to set this number lower if your internet
#' connection is spotty. The default (`NA`) will set the limit to the maximum
#' allowable limit for the service.
#' @param max_results The optional maximum number of rows to return. This value
#' must be less than the requested limit.
#' @param skipGeometry This option can be used to skip response geometries for
#' each feature. The returning object will be a data frame with no spatial
#' information.
#' @param convertType logical, defaults to `TRUE`. If `TRUE`, the function
#' will convert the data to dates and qualifier to string vector.
#' @examplesIf is_dataRetrieval_user()
#'
#' \donttest{
#' site <- "USGS-02238500"
#' field_data_sf <- read_waterdata_field_measurements(monitoring_location_id = site)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an explanation as to why gwlevels are considered "field measurements"? As a non-hydrologist, this seems kind of random.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's basically all discrete data that does go to the water quality portal.

#'
#' groundwater <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201")
#'
#' gwl_data <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201",
#' parameter_code = "72019",
#' skipGeometry = TRUE)
#'
#' gwl_data_period <- read_waterdata_field_measurements(
#' monitoring_location_id = "USGS-375907091432201",
#' parameter_code = "72019",
#' time = "P20Y")
#'
#' multi_site <- read_waterdata_field_measurements(
#' monitoring_location_id = c("USGS-451605097071701",
#' "USGS-263819081585801"),
#' parameter_code = c("62611", "72019"))
#'
#' old_df <- read_waterdata_field_measurements(monitoring_location_id = "USGS-425957088141001",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be helpful to have a surface water example, too. These examples led me to check whether "field measurements" was JUST groundwater levels.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this one for fun and it returned 86 values:

test <- read_waterdata_field_measurements(
  bbox = c(-94, 36, -90, 39),
  time = "2025-07-01T00:00:00Z/..",
  parameter_code = "00060"
)

#' time = c("1980-01-01", NA))
#'
#'
#' }
read_waterdata_field_measurements <- function(monitoring_location_id = NA_character_,
parameter_code = NA_character_,
observing_procedure_code = NA_character_,
properties = NA_character_,
field_visit_id = NA_character_,
approval_status = NA_character_,
unit_of_measure = NA_character_,
qualifier = NA_character_,
value = NA,
last_modified = NA_character_,
observing_procedure = NA_character_,
vertical_datum = NA_character_,
measuring_agency = NA_character_,
skipGeometry = NA,
time = NA_character_,
bbox = NA,
limit = NA,
max_results = NA,
convertType = TRUE){

service <- "field-measurements"
output_id <- "field_measurement_id"

args <- mget(names(formals()))
return_list <- get_ogc_data(args,
output_id,
service)

return_list <- return_list[order(return_list$time, return_list$monitoring_location_id), ]

return(return_list)
}



Loading
Loading