Route public transport connections with geometries (
LINESTRING) between pairs of points using the HERE 'Public Transit' API.
Two modes are provided:
summary = FALSE: The public transport connections are returned as mulitple sections with the same vehicle and transport mode. Each section has a detailed route geometry.
summary = TRUE: A summary of the connections is retrieved, where each connection is represented as one row with a unified and simplified geometry.
connection( origin, destination, datetime = Sys.time(), arrival = FALSE, results = 3, transfers = -1, summary = FALSE, url_only = FALSE )
boolean, calculate connections for arrival at the defined time (
numeric, maximum number of suggested public transport routes (Valid range: 1 and 6).
numeric, maximum number of transfers allowed per route (Valid range: -1 and 6,
boolean, return a summary of the public transport connections instead of the sections of the routes (
boolean, only return the generated URLs (
sf object containing the requested routes.
# Provide an API Key for a HERE project set_key("<YOUR API KEY>") # Connection sections sections <- connection( origin = poi[3:4, ], destination = poi[5:6, ], summary = FALSE, url_only = TRUE ) # Connection summary summary <- connection( origin = poi[3:4, ], destination = poi[5:6, ], summary = TRUE, url_only = TRUE )