connection {hereR} | R Documentation |
HERE Public Transit API: Transit Route
Description
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.
Usage
connection(
origin,
destination,
datetime = Sys.time(),
arrival = FALSE,
results = 3,
transfers = -1,
transport_mode = NULL,
summary = FALSE,
url_only = FALSE
)
Arguments
origin |
|
destination |
|
datetime |
|
arrival |
boolean, calculate connections for arrival at the defined time ( |
results |
numeric, maximum number of suggested public transport routes (Valid range: 1 and 6). |
transfers |
numeric, maximum number of transfers allowed per route (Valid range: -1 and 6, whereby the |
transport_mode |
character, enable or disable ( |
summary |
boolean, return a summary of the public transport connections instead of the sections of the routes ( |
url_only |
boolean, only return the generated URLs ( |
Value
An sf
object containing the requested routes.
References
HERE Public Transit API: Transit Route
Examples
# 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
)