Computes estimated travel time between two points using public transport. If time and time_type are not specified, time of travel will be assumed to be the same time at which the request is made.

get_travel_time(
  start_coord,
  end_coord,
  time = NULL,
  time_type = NULL,
  api_token = Sys.getenv("CITYMAPPER_API_TOKEN")
)

Arguments

start_coord

Geographical coordinates of the start point in WGS84 '<latitude>,<longitude>' format.

end_coord

Geographical coordinates of the arrival point in WGS84 '<latitude>,<longitude>' format.

time

A date & time in ISO-8601 format (e. If omitted, it will be computed by the endpoint.

time_type

Required if `time` is provided. At the moment the only defined type is `arrival`, it computes the travel time for arriving at `end_coord` at the given time.

api_token

Citymapper's api key (chr).

Value

Estimated travel time in minutes (int).

Author

Andrea Dodet, an.dodet@gmail.com

Examples

if (FALSE) {
get_travel_time(start_coord = "45.448643,9.207645",
                end_coord = "45.452349,9.180225")
}