Learn R Programming

hereR (version 1.1.0)

weather: HERE Destination Weather API: Observations, Forecasts, Astronomy and Alerts

Description

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.

Usage

weather(poi, product = "observation", url_only = 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.

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)?

References

HERE Destination Weather API

Examples

Run this code
# Provide an API Key for a HERE project
set_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)

Run the code above in your browser using DataLab