get_travel_time: Get travel time between two points

Description Usage Arguments Value Author(s) Examples

View source: R/get_travel_time.R

Description

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.

Usage

1
2
3
4
5
6
7
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(s)

Andrea Dodet, an.dodet@gmail.com

Examples

1
2
3
4
5
## Not run: 
get_travel_time(start_coord = "45.448643,9.207645",
                end_coord = "45.452349,9.180225")

## End(Not run)

andodet/citymappR documentation built on Oct. 18, 2021, 6:11 p.m.