Learn R Programming

hereR (version 0.3.2)

flow: HERE Traffic API: Flow

Description

Real-time traffic flow from the HERE 'Traffic' API in areas of interest (AOIs). The traffic flow data contains speed ("SP") and congestion (jam factor: "JF") information, which corresponds to the status of the traffic at the time of the query.

Usage

flow(aoi, min_jam_factor = 0, url_only = FALSE)

Arguments

aoi

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

min_jam_factor

numeric, only retrieve flow information with a jam factor greater than the value provided (default = 0).

url_only

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

Value

An sf object containing the requested traffic flow information.

References

Examples

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

# Real-time traffic flow
flow <- flow(
  aoi = aoi[aoi$code == "LI", ],
  url_only = TRUE
)
# }

Run the code above in your browser using DataLab