Learn R Programming

hereR (version 0.3.2)

isoline: HERE Routing API: Calculate Isoline

Description

Calcuates isolines (POLYGON or MULTIPOLYGON) using the HERE 'Routing' API that connect the end points of all routes leaving from defined centers (POIs) with either a specified length, a specified travel time or consumption.

Usage

isoline(
  poi,
  datetime = Sys.time(),
  arrival = FALSE,
  range = seq(5, 30, 5) * 60,
  range_type = "time",
  type = "fastest",
  mode = "car",
  traffic = FALSE,
  aggregate = TRUE,
  url_only = FALSE
)

Arguments

poi

sf object, Points of Interest (POIs) of geometry type POINT.

datetime

POSIXct object, datetime for the departure (or arrival if arrival = TRUE).

arrival

boolean, are the provided Points of Interest (POIs) the origin or destination locations (default = FALSE)?

range

numeric, a vector of type integer containing the breaks for the generation of the isolines: (1) time in seconds; (2) distance in meters; (3) consumption in costfactor.

range_type

character, unit of the isolines: "distance", "time" or "consumption".

type

character, set the routing type: "fastest" or "shortest".

mode

character, set the transport mode: "car", "pedestrian" or "truck".

traffic

boolean, use real-time traffic or prediction in routing (default = FALSE)? If no datetime is set, the current timestamp at the moment of the request is used for datetime.

aggregate

boolean, aggregate (with function min) and intersect the isolines from geometry type POLYGON to geometry type MULTIPOLYGON (default = TRUE)?

url_only

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

Value

An sf object containing the requested isolines.

References

HERE Routing API: Calculate Isoline

Examples

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

# Isochrone for 5, 10, 15, 20, 25 and 30 minutes driving time
isolines <- isoline(
  poi = poi,
  range = seq(5, 30, 5) * 60,
  url_only = TRUE
)
# }

Run the code above in your browser using DataLab