Commit 962d99d1 authored by Dorchies David's avatar Dorchies David
Browse files

feat(hydrometrie): add obs_elab interface

Refs #14
parent c0bd3602
Pipeline #30359 passed with stage
in 1 minute and 16 seconds
......@@ -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)
......
#' 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)
}
......@@ -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:
......
% 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"))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment