Commit 73c95280 authored by Dorchies David's avatar Dorchies David
Browse files

feat: add `get_niveaux_nappes_stations`

Refs #8
parent 64e01df4
Pipeline #26141 passed with stages
in 2 minutes and 1 second
......@@ -7,6 +7,7 @@ export(get_hydrometrie_sites)
export(get_hydrometrie_stations)
export(get_indicateurs_services_communes)
export(get_indicateurs_services_indicateurs)
export(get_niveaux_nappes_stations)
export(get_prelevements_chroniques)
export(get_prelevements_ouvrages)
export(get_prelevements_points_prelevement)
......@@ -5,7 +5,7 @@
#' @template param_get_common
#' @param code_sandre_reseau_station optional [logical] indicating if `code_sandre_reseau_station` field is included in the result; if so, one line is added by item and other fields are repeated
#'
#' @return a [tibble::tibble] with all available parameters in columns and one row by device, year and usage.
#' @return a [tibble::tibble] with all available parameters in columns and one row by station.
#' @export
#'
#' @examples
......
#' Retrieve piezometric stations from API "Piézométrie"
#'
#' See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
#'
#' @template param_get_common
#'
#' @return a [tibble::tibble] with all available parameters in columns and one row by station.
#' @export
#'
#' @examples
#' # For retrieving the hydrometric stations in the department of Aube
#' get_niveaux_nappes_stations(list(code_departement = "10"))
#'
get_niveaux_nappes_stations <- function(params, cfg = config::get(file = system.file("config.yml",
package = "hubeau"))) {
l <- doApiQuery(api = "niveaux_nappes",
operation = "stations",
params = params,
cfg = cfg)
l <- lapply(l, function(x) {
x$geometry <- NULL
x
})
convert_list_to_tibble(l)
}
......@@ -23,6 +23,14 @@
#' - [get_indicateurs_services_communes]
#' - [get_indicateurs_services_indicateurs]
#'
#' **API "Piézométrie"**
#'
#' API documentation: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
#'
#' Available functions:
#'
#' - [get_niveaux_nappes_stations]
#'
#' **API "Prélèvements en eau"**
#'
#' API documentation: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
......
......@@ -150,3 +150,50 @@ default:
- latitude
- longitude
- timestep
niveaux_nappes:
path: v1/niveaux_nappes
operations:
stations:
path: stations
fields:
- bbox
- bss_id
- code_bdlisa
- code_bss
- code_commune
- code_departement
- codes_masse_eau_edl
- date_recherche
- fields
- srid
sites:
path: referentiel/sites
fields:
- bbox
- code_commune_site
- code_cours_eau
- code_departement
- code_region
- code_site
- code_troncon_hydro_site
- code_zone_hydro_site
- distance
- fields
- latitude
- libelle_cours_eau
- libelle_site
- longitude
observations_tr:
path: observations_tr
fields:
- bbox
- code_entite
- cursor
- date_debut_obs
- date_fin_obs
- distance
- fields
- grandeur_hydro
- latitude
- longitude
- timestep
......@@ -19,7 +19,7 @@ get_hydrometrie_stations(
configuration}
}
\value{
a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by device, year and usage.
a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by station.
}
\description{
See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_niveaux_nappes_stations.R
\name{get_niveaux_nappes_stations}
\alias{get_niveaux_nappes_stations}
\title{Retrieve piezometric stations from API "Piézométrie"}
\usage{
get_niveaux_nappes_stations(
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 station.
}
\description{
See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
}
\examples{
# For retrieving the hydrometric stations in the department of Aube
get_niveaux_nappes_stations(list(code_departement = "10"))
}
......@@ -31,6 +31,15 @@ Available functions:
\item \link{get_indicateurs_services_indicateurs}
}
\strong{API "Piézométrie"}
API documentation: \url{https://hubeau.eaufrance.fr/page/api-piezometrie}
Available functions:
\itemize{
\item \link{get_niveaux_nappes_stations}
}
\strong{API "Prélèvements en eau"}
API documentation: \url{https://hubeau.eaufrance.fr/page/api-prelevements-eau}
......
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