Learn R Programming

hereR (version 0.3.2)

incident: HERE Traffic API: Incidents

Description

Traffic incident information from the HERE 'Traffic' API in areas of interest (AOIs). The incidents contain information about location, duration, severity, type, description and further details.

Usage

incident(aoi, from = Sys.time() - 60 * 60 * 24 * 7, url_only = FALSE)

Arguments

aoi

sf object, Areas of Interest (POIs) of geometry type POLYGON.

from

POSIXct object, datetime of the earliest traffic incidents (default = FALSE).

url_only

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

Value

An sf object containing the traffic incidents.

References

HERE Traffic API: Incidents

Examples

Run this code
# NOT RUN {
# Provide an API Key for a HERE project
set_key("<YOUR API KEY>")

# All traffic incidents from the beginning of 2018
incidents <- incident(
  aoi = aoi,
  from = as.POSIXct("2018-01-01 00:00:00"),
  url_only = TRUE
)
# }

Run the code above in your browser using DataLab