gtfs_traveltimes {gtfsrouter} | R Documentation |
gtfs_traveltimes
Description
Travel times from a nominated station departing at a nominated time to every other reachable station in a system.
Usage
gtfs_traveltimes(
gtfs,
from,
start_time_limits,
day = NULL,
from_is_id = FALSE,
grep_fixed = TRUE,
route_pattern = NULL,
minimise_transfers = FALSE,
max_traveltime = 60 * 60,
quiet = FALSE
)
Arguments
gtfs |
A set of GTFS data returned from extract_gtfs or, for more efficient queries, pre-processed with gtfs_timetable. |
from |
Name, ID, or approximate (lon, lat) coordinates of start station
(as |
start_time_limits |
A vector of two integer values denoting the earliest and latest departure times in seconds for the traveltime values. |
day |
Day of the week on which to calculate route, either as an
unambiguous string (so "tu" and "th" for Tuesday and Thursday), or a number
between 1 = Sunday and 7 = Saturday. If not given, the current day will be
used. (Not used if |
from_is_id |
Set to |
grep_fixed |
If |
route_pattern |
Using only those routes matching given pattern, for
example, "^U" for routes starting with "U" (as commonly used for underground
or subway routes. To negate the |
minimise_transfers |
If |
max_traveltime |
The maximal traveltime to search for, specified in seconds (with default of 1 hour). See note for details. |
quiet |
Set to |
Value
A data.frame
of travel times and required numbers of transfers to
all stations reachable from the given from
station. Additional columns
include "start_time" of connection, and information on destination stops
including "id" numbers, names, and geographical coordinates.
Note
Higher values of max_traveltime
will return traveltimes for greater
numbers of stations, but may lead to considerably longer calculation times.
For repeated usage, it is recommended to first establish a value sufficient
to reach all or most stations desired for a particular query, rather than set
max_traveltime
to an arbitrarily high value.
See Also
Other main:
gtfs_route_headway()
,
gtfs_route()
Examples
# Examples must be run on single thread only:
nthr <- data.table::setDTthreads (1)
berlin_gtfs_to_zip ()
f <- file.path (tempdir (), "vbb.zip")
g <- extract_gtfs (f)
g <- gtfs_timetable (g)
from <- "Alexanderplatz"
start_times <- 12 * 3600 + c (0, 60) * 60 # 8:00-9:00
res <- gtfs_traveltimes (g, from, start_times)
data.table::setDTthreads (nthr)