diff --git a/NAMESPACE b/NAMESPACE index ed1cd39cc1115c6dc32910a92accf237da17d793..8fa7bbeaf4b8daffb359e8a6db8095854212dd96 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ export(doApiQuery) export(get_available_params) +export(get_hydrometrie_obs_elab) export(get_hydrometrie_observations_tr) export(get_hydrometrie_sites) export(get_hydrometrie_stations) diff --git a/R/get_hydrometrie_obs_elab.R b/R/get_hydrometrie_obs_elab.R new file mode 100644 index 0000000000000000000000000000000000000000..c11e57bc7f2a120c3146b46e3ecc3dcd7b1fd34c --- /dev/null +++ b/R/get_hydrometrie_obs_elab.R @@ -0,0 +1,23 @@ +#' Retrieve hydrometric elaborate observations from API "Hydrométrie" +#' +#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie#operations-hydrometrie-observationsElaborees} +#' +#' @template param_get_common +#' +#' @return a [tibble::tibble] with all available parameters in columns and one row by time step and by station. +#' @export +#' +#' @examples +#' # Retrieve the hydrometric last real time observed discharge at station 'H020302002' +#' get_hydrometrie_obs_elab(list(code_entite = "H0203020", grandeur_hydro_elab = "QmM")) +get_hydrometrie_obs_elab <- function(params, + cfg = config::get(file = system.file("config.yml", + package = "hubeau"))) { + l <- doApiQuery( + api = "hydrometrie", + operation = "obs_elab", + params = params, + cfg = cfg + ) + convert_list_to_tibble(l) +} diff --git a/inst/config.yml b/inst/config.yml index a88f2f77f32df5bd1cc26cef6388796a282f4d0c..628a16269e3feec2b16f71ac9ceed5d4861e4a65 100644 --- a/inst/config.yml +++ b/inst/config.yml @@ -150,6 +150,21 @@ default: - latitude - longitude - timestep + obs_elab: + path: obs_elab + fields: + - bbox + - code_entite + - cursor + - date_debut_obs_elab + - date_fin_obs_elab + - distance + - fields + - grandeur_hydro_elab + - latitude + - longitude + - resultat_max + - resultat_min niveaux_nappes: path: v1/niveaux_nappes operations: diff --git a/man/get_hydrometrie_obs_elab.Rd b/man/get_hydrometrie_obs_elab.Rd new file mode 100644 index 0000000000000000000000000000000000000000..b81c3e13daf9cabb995ff5dc1896c2a636076726 --- /dev/null +++ b/man/get_hydrometrie_obs_elab.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_hydrometrie_obs_elab.R +\name{get_hydrometrie_obs_elab} +\alias{get_hydrometrie_obs_elab} +\title{Retrieve hydrometric elaborate observations from API "Hydrométrie"} +\usage{ +get_hydrometrie_obs_elab( + params, + cfg = config::get(file = system.file("config.yml", package = "hubeau")) +) +} +\arguments{ +\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters} + +\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package +configuration} +} +\value{ +a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by time step and by station. +} +\description{ +See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie#operations-hydrometrie-observationsElaborees} +} +\examples{ +# Retrieve the hydrometric last real time observed discharge at station 'H020302002' +get_hydrometrie_obs_elab(list(code_entite = "H0203020", grandeur_hydro_elab = "QmM")) +}