Weather forecasts, reports on current weather conditions, astronomical information and alerts at a specific location (coordinates or location name) based on the HERE 'Destination Weather' API. The information comes from the nearest available weather station and is not interpolated.

weather(poi, product = "observation", url_only = FALSE)

Arguments

poi

sf object or character, Points of Interest (POIs) of geometry type POINT or location names (e.g. cities or regions).

product

character, weather product of the 'Destination Weather API'. Supported products: "observation", "forecastHourly", "forecastAstronomy" and "alerts".

url_only

boolean, only return the generated URLs (default = FALSE)?

Value

An sf object containing the requested weather information at the nearest weather station. The point geometry in the sf object is the location of the weather station.

Examples

# Provide an API Key for a HERE project
set_key("<YOUR API KEY>")

# Observation
observation <- weather(poi = poi, product = "observation", url_only = TRUE)

# Forecast
forecast <- weather(poi = poi, product = "forecast_hourly", url_only = TRUE)

# Astronomy
astronomy <- weather(poi = poi, product = "forecast_astronomy", url_only = TRUE)

# Alerts
alerts <- weather(poi = poi, product = "alerts", url_only = TRUE)