Weather forecasts, reports on current weather conditions, astronomical information and alerts at a specific location based on the ‘HERE Destination Weather’ API.

Observations

In order to request information about the current weather situation points of interest (POIs) have to be provided. The POIs must be an sf object containing geometries of type POINT or a character vector containing place names (e.g. cities). These POIs are passed to the weather() function, whereby the product parameter is set to "observation":

The return value is an sf object, which contains the POINT geometries of the provided POIs and the most recent record on the observed weather. The measurements are taken from the nearest weather observation stations with respect to the POIs. The distance of the stations to the provided POIs is an indicator for the reliabilty of the weather information at each POI. A table of the observed weather near the example POIs:

station distance description temperature humidity windSpeed windDirection
Rönnimoos 450 Fog. Chilly. 0.00 100 1.85 0
Lugano 670 Clear. Quite cool. 5.00 76 1.85 0
Chailly 340 Chilly. 4.28 88 1.85 210
Kleinhüningen 430 Clear. Chilly. 4.00 81 9.27 180
Kehrsatz 620 Clear. Chilly. 1.00 87 3.71 310
Zürich (Kreis 6) / Oberstrass 820 Clear. Chilly. 2.00 87 3.71 0
Geneva 490 Clear. Chilly. 4.00 81 3.71 0
Vaduz 940 Chilly. 2.11 72 0.00 340

Print the weather observation information on an interactive leaflet map:

Forecast

An hourly forecast of the predicted weather for the following seven days can be obtained by setting the product parameter to "forecast_hourly"

Print the weather observation information on an interactive leaflet map with popup graphs for temperature and humidity:

  1. Create a list containing the temperature and humidity graphs for every POI:
  1. Then add list of graphs to the leaflet map using the the popup parameter:

Astronomy

An astronomical forecast is requested by setting the product parameter to "forecast_astronomy":

Print a table for the sun and moon times of the first example POI, where the nearest station is ‘Emmenbrücke’:
date sunrise sunset moonrise moonset phase
2020-01-06 8:12AM 4:53PM 1:45PM 3:29AM Waxing gibbous
2020-01-07 8:12AM 4:54PM 2:15PM 4:36AM Waxing gibbous
2020-01-08 8:12AM 4:55PM 2:53PM 5:45AM Waxing gibbous
2020-01-09 8:11AM 4:56PM 3:40PM 6:52AM Waxing gibbous
2020-01-10 8:11AM 4:57PM 4:38PM 7:54AM Full moon
2020-01-11 8:11AM 4:59PM 5:46PM 8:49AM Full moon
2020-01-12 8:10AM 5:00PM 7:01PM 9:35AM Full moon
2020-01-13 8:10AM 5:01PM 8:20PM 10:12AM Waning gibbous

Alerts

Current weather alerts, near provided POIs, are obtain by the product alerts:

This returns an sf object with the POIs and the attribute "alerts", which is a data.table, which contains the current weather alerts. If no alerts are recorded near a POI the attribute "alerts" is NULL.