-
Notifications
You must be signed in to change notification settings - Fork 97
Latest field #912
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
Merged
Merged
Latest field #912
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
95e4113
rerun docs
ldecicco-USGS 7bbf399
add metadata output to read_waterdata_ratings output
mconlon91 d818d77
remove stringsAsFactors
mconlon91 11cd293
Merge branch 'ratings_metadata' into 'develop'
ldecicco-USGS 834741b
Merge branch 'develop' of https://code.usgs.gov/water/dataRetrieval i…
ldecicco-USGS ef7756a
building the docs
ldecicco-USGS d5a4499
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into develop
ldecicco-USGS cb6e1bd
remove functions that don't work
ldecicco-USGS ddaca79
Cleanup pkgdown
ldecicco-USGS c7fe179
Allow geometry in continuous
ldecicco-USGS bbfcca7
fix note
ldecicco-USGS e94f179
latest field
ldecicco-USGS 3f01762
upstream pull
ldecicco-USGS 5ac5c76
Merge branch 'develop' of github.com:DOI-USGS/dataRetrieval into late…
ldecicco-USGS 51792cf
First pass at latest_field
ldecicco-USGS eb88086
change name
ldecicco-USGS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
| #' for new direct download functions that are expected to be available sometime | ||
| #' in 2026. | ||
| #' | ||
| #' Geometry output is not supported in the continuous data API endpoint. | ||
| #' | ||
| #' @export | ||
| #' @param monitoring_location_id `r get_ogc_params("continuous")$monitoring_location_id` | ||
|
|
@@ -35,6 +34,7 @@ | |
| #' @param \dots Not used. Included to help differentiate official Water Data API arguments | ||
| #' from more seldom used, optional dataRetrieval-specific arguments. | ||
| #' @inheritParams check_arguments_non_api | ||
| #' @inheritParams check_arguments_api | ||
| #' | ||
| #' @details | ||
| #' You can also use a vector of length 2 for any time queries (such as time | ||
|
|
@@ -120,6 +120,8 @@ read_waterdata_continuous <- function( | |
| value = NA, | ||
| last_modified = NA_character_, | ||
| time = NA_character_, | ||
| skipGeometry = TRUE, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😎 |
||
| bbox = NA, | ||
| ..., | ||
| convertType = getOption("dataRetrieval.convertType"), | ||
| limit = getOption("dataRetrieval.limit"), | ||
|
|
@@ -132,7 +134,6 @@ read_waterdata_continuous <- function( | |
| rlang::check_dots_empty() | ||
|
|
||
| args <- mget(names(formals())) | ||
| args[["skipGeometry"]] <- TRUE | ||
|
|
||
| return_list <- get_ogc_data(args, output_id, service) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #' Get latest USGS field measurement data | ||
| #' | ||
| #' @description `r get_description("latest-field-measurements")` | ||
| #' | ||
| #' @export | ||
| #' @param monitoring_location_id `r get_ogc_params("latest-field-measurements")$monitoring_location_id` | ||
| #' Multiple monitoring_location_ids can be requested as a character vector. | ||
| #' @param parameter_code `r get_ogc_params("latest-field-measurements")$parameter_code` | ||
| #' Multiple parameter_codes can be requested as a character vector. | ||
| #' @param statistic_id `r get_ogc_params("latest-field-measurements")$statistic_id` | ||
| #' Multiple statistic_ids can be requested as a character vector. | ||
| #' @param time `r get_ogc_params("latest-field-measurements")$time` | ||
| #' | ||
| #' See also Details below for more information. | ||
| #' @param value `r get_ogc_params("latest-field-measurements")$value` | ||
| #' @param unit_of_measure `r get_ogc_params("latest-field-measurements")$unit_of_measure` | ||
| #' @param approval_status `r get_ogc_params("latest-field-measurements")$approval_status` | ||
| #' @param last_modified `r get_ogc_params("latest-field-measurements")$last_modified` | ||
| #' | ||
| #' See also Details below for more information. | ||
| #' @param time_series_id `r get_ogc_params("latest-field-measurements")$time_series_id` | ||
| #' Multiple time_series_ids can be requested as a character vector. | ||
| #' @param qualifier `r get_ogc_params("latest-field-measurements")$qualifier` | ||
| #' @param properties A vector of requested columns to be returned from the query. | ||
| #' Available options are: | ||
| #' `r dataRetrieval:::get_properties_for_docs("latest-field-measurements", "latest_field_id")`. | ||
| #' The default (`NA`) will return all columns of the data. | ||
| #' | ||
| #' @inheritParams check_arguments_api | ||
| #' @inheritParams check_arguments_non_api | ||
| #' @inherit read_waterdata_continuous details | ||
| #' | ||
| #' @examplesIf is_dataRetrieval_user() | ||
| #' | ||
| #' \donttest{ | ||
| #' site <- "USGS-01435000" | ||
| #' | ||
| #' field_data_sf <- read_waterdata_latest_field_measurements(monitoring_location_id = site) | ||
| #' | ||
| #' dv_data_trim <- read_waterdata_latest_field_measurements(monitoring_location_id = site, | ||
| #' properties = c("monitoring_location_id", | ||
| #' "value", | ||
| #' "time")) | ||
| #' | ||
| #' field_data <- read_waterdata_latest_field_measurements(monitoring_location_id = site, | ||
| #' skipGeometry = TRUE) | ||
| #' | ||
| #' multi_site <- read_waterdata_latest_field_measurements(monitoring_location_id = c("USGS-01435000", | ||
| #' "USGS-14202650")) | ||
| #' | ||
| #' } | ||
| read_waterdata_latest_field_measurements <- function( | ||
| monitoring_location_id = NA_character_, | ||
| parameter_code = NA_character_, | ||
| statistic_id = NA_character_, | ||
| properties = NA_character_, | ||
| time_series_id = NA_character_, | ||
| approval_status = NA_character_, | ||
| unit_of_measure = NA_character_, | ||
| qualifier = NA_character_, | ||
| value = NA, | ||
| last_modified = NA_character_, | ||
| skipGeometry = NA, | ||
| time = NA_character_, | ||
| bbox = NA, | ||
| ..., | ||
| convertType = getOption("dataRetrieval.convertType"), | ||
| no_paging = getOption("dataRetrieval.no_paging"), | ||
| limit = getOption("dataRetrieval.limit"), | ||
| chunk_size = getOption("dataRetrieval.site_chunk_size_meta"), | ||
| attach_request = getOption("dataRetrieval.attach_request") | ||
| ) { | ||
| service <- "latest-field-measurements" | ||
| output_id <- "latest_field_id" | ||
| rlang::check_dots_empty() | ||
|
|
||
| args <- mget(names(formals())) | ||
| return_list <- get_ogc_data(args, output_id, service) | ||
|
|
||
| return(return_list) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change from Air formatter? Are there other, old files in the project that haven't been similarly formatted yet and if we could do so in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a PR awhile back which was a ton of Air formatting updates. Not sure why this didn't make it in back then.