get_stations_info_from {meteospain} | R Documentation |
Get meteorological stations info
Description
Obtain info and metadata for the available stations in the different services
Usage
get_stations_info_from(
service = c("aemet", "meteocat", "meteoclimatic", "meteogalicia", "ria"),
options
)
Arguments
service |
Character with the service name (in lower case). |
options |
List with the needed service options. See |
Details
Depending on the service the metadata available can be different. Also, some services only offer
info for active stations (i.e. AEMET), not historical stations, so some mismatch can occur between
the stations returned by this function and the stations returned by get_meteo_from
for
historical dates.
Value
An sf (spatial) object with the stations metadata.
Cache
In order to avoid unnecessary API calls, results of this function are cached in memory with
memoise
. This means that subsequent calls from get_meteo_from
with the same
arguments will be faster as they will not call the meteorological service API. This cache has a maximum
size of 1024 MB and persist 24 hours in the same R session after loading the package.
To forgot the cache, memoise::forget(get_stations_info_from)
can be used.
Examples
if (identical(Sys.getenv("NOT_CRAN"), "true")) {
library(meteospain)
library(keyring)
# AEMET (we need a key)
# key_set('aemet')
api_options <- aemet_options(api_key = key_get('aemet'))
get_stations_info_from('aemet', api_options)
}