Obtain info and metadata for the available stations in the different services

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 services_options to have more info about the different services and their options.

Value

An sf (spatial) object with the stations metadata.

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.

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

# \donttest{
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)
}
#> Simple feature collection with 947 features and 5 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -18.115 ymin: 27.66528 xmax: 4.323889 ymax: 43.78611
#> Geodetic CRS:  WGS 84
#> # A tibble: 947 × 6
#>    service station_id station_name                  station_province altitude
#>  * <chr>   <chr>      <chr>                         <chr>                 [m]
#>  1 aemet   B013X      ESCORCA, LLUC                 ILLES BALEARS         490
#>  2 aemet   B051A      SÓLLER, PUERTO                ILLES BALEARS           5
#>  3 aemet   B087X      BANYALBUFAR                   ILLES BALEARS          60
#>  4 aemet   B103B      ANDRATX - SANT ELM            ILLES BALEARS          52
#>  5 aemet   B158X      CALVIÀ, ES CAPDELLÀ           ILLES BALEARS          50
#>  6 aemet   B228       PALMA, PUERTO                 ILLES BALEARS           3
#>  7 aemet   B236C      PALMA, UNIVERSIDAD            ILLES BALEARS          95
#>  8 aemet   B248       SIERRA DE ALFABIA, BUNYOLA    ILLES BALEARS        1030
#>  9 aemet   B275E      SON BONET, AEROPUERTO         BALEARES               49
#> 10 aemet   B278       PALMA DE MALLORCA, AEROPUERTO ILLES BALEARS           8
#> # ℹ 937 more rows
#> # ℹ 1 more variable: geometry <POINT [°]>
# }