Description Usage Arguments Details Value See Also
This function calculates travel times in a multi-modal network from a specified location anywhere within the grid of a GTFS-Multi feed to all grid points of that grid. The travel times are the shortest multi-modal travel times within the bounds of acceptable departure times. Travel times may also be single-modal in case it is faster to travel directly from the origin to the destination, i.e. without using transit at all.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | multinet_traveltimes(
x,
from,
start_time_limits,
access_modes = NULL,
direct_modes = NULL,
egress_modes = NULL,
transfer_modes = NULL,
access_limit = Inf,
direct_limit = Inf,
egress_limit = Inf,
transfer_limit = Inf,
minimise_transfers = FALSE,
include_grid_access = TRUE,
iterate = FALSE,
quiet = FALSE,
access_frequency = 60,
grid_access_speed = 5/3.6,
router_timeout = 60 * 60,
day = NULL,
date = NULL
)
|
x |
An object of class |
from |
Origin of the routes. May be the index of a grid point. In that
case it should correspond to a value in the stop_id column of the grid
table in x. May also be any location inside the extent of the grid. Such a
location may be given as a single |
start_time_limits |
A vector of two integer values denoting the start and end of the time interval in which trips may be started. Values should be given in seconds since midnight. |
access_modes |
Vector of transport modes to consider for access trips,
i.e. trips from grid points towards transit stop locations.
Each of these transport modes should have their access travel time for each
access trip specified in the access table of |
direct_modes |
Vector of transport modes to consider for direct trips,
i.e. trips between grid points.
Each of these transport modes should have their direct travel time for each
direct trip specified in the direct table of |
egress_modes |
Vector of transport modes to consider for egress trips,
i.e. trips from transit stop locations towards grid points.
Each of these transport modes should have their egress travel time for each
egress trip specified in the egress table of |
transfer_modes |
Vector of transport modes to consider for true transit
transfer trips, i.e. trips between transit stop locations.
Each of these transport modes should have their transfer travel time for
each transfer trip specified in the transfer table of |
access_limit |
Maximum time in seconds for access trips. Any access
trip in the access table of |
direct_limit |
Maximum time in seconds for direct trips. Any direct
trip in the direct table of |
egress_limit |
Maximum time in seconds for egress trips. Any egress
trip in the egress table of |
transfer_limit |
Maximum time in seconds for transfer trips. Any
transfer trip in the transfer table of |
minimise_transfers |
Boolean. If |
include_grid_access |
Boolean. If |
iterate |
Boolean. If |
quiet |
Boolean. If |
access_frequency |
At what frequency should access trips be allowed to start? Value should be given in seconds. Smaller values will provide more accurate results, since access trips can in reality be started at anytime, but also increase processing time. Defaults to 60, i.e. every minute. |
grid_access_speed |
Speed at which the straight-line distance between
the origin location and its nearest grid point can be travelled. Only
considered when |
router_timeout |
Cumulative travel time in seconds after which the routing algorithm will exit the search for a route. Hence, if during the search for a route between the selected origin grid point and a transit stop (see step 2 in Details) the cumulative travel time exceeds this value, the algorithm will stop looking for a connection and marks the particular transit stop as unreachable. Defaults to 60 * 60, i.e. one hour. |
day |
Day of the week for which the timetable should be created. May
be given as unambiguous string (e.g. "tu" and "th" for Tuesday and
Thursday), or an integer between 1 = Sunday and 7 = Saturday. If |
date |
Date for which the timetable should be created. Should be given
as a single 8-digit integer representing "yyyymmdd". This parameter is meant
to be used with feeds that contain a
calendar_dates
table, either to specify service availability separately for each date, or
to list exceptions to the regular service availability as specified in the
calendar
table. Ignored when |
Travel times are calculated as with the following steps:
The nearest grid point to origin
is found. An imaginary pre-leg of the
trip accounts to some extent for the distance between these two points. This
distance (as-the-crow-flies) is assumed to be travelled at a fixed speed,
specified in the grid_access_speed
parameter. By default its value is set
to a walking-like speed of 5 / 3.6 m/s, i.e. 5 km/h. When setting
include_grid_access = FALSE
the distance between the actual origin
location and its nearest grid point is not accounted for and the trip is
assumed to effectively start at the nearest grid point. Keep again in mind
that no matter what approach you choose, results get less accurate with a
coarser grid.
For each transit stop listed in the stops table of x
, the shortest
multi-modal travel time from the selected grid point to that stop is
calculated. This is done by a purely timetable-based routing algorithm.
Access trips listed in the access table of x
that originate from the
selected grid point are included in the transit timetable by modelling them
as direct transit trips from the selected grid point towards reachable
transit stops, operating on a frequency-based schedule. The frequency of
these trips is defined by the access_frequency
parameter, which by default
is set to 60 seconds, i.e. one departure every minute. The length of such an
access trip is the minimum travel time for a given access connection among
all different modes that are present in the access table. The modes can be
subsetted by setting the access_modes
parameter, e.g.
access_modes = "walk"
to include only access times by foot. Possible trips
itself may be filtered as well, by setting a maximum allowed travel time
through the access_limit
parameter. During the transit leg of the trip it
is possible to transfer from one vehicle to another using a transfer
connection listed in the transfers table of x
. The travel time of such
a transfer connection is the minimum travel time among all different modes
that are present in the transfer table. The modes can be subsetted by
setting the transfer_modes
parameter, e.g. transfer_modes = "walk"
to
include only transfer times by foot. Possible trips itself may be filtered
as well, by setting a maximum allowed travel time through the
transfer_limit
parameter. For efficiency reasons, the routing algorithm in
this phase has an upper bound defined, meaning that if the cumulative travel
time of a trip from the selected grid point exceeds this upper bound before
the transit stop is reached, the search for a route to that stop is
terminated and the transit stop is marked as unreachable. This upper bound
can be defined through the router_timeout
parameter and defaults to
60 * 60 seconds, i.e. 1 hour.
For each destination grid point (i.e. all grid points except the one
selected as origin) listed in the grid table of x
, multi-modal travel
times from the selected origin grid point to that destination grid point are
calculated. This is done by extracting travel times of egress trips that
lead to the destination grid point from the egress table of x
, and
adding those to the travel times from the origin grid point towards transit
stops as calculated in the previous step. For a destination grid point
this will often result in a set of multiple travel times (since there may be
multiple egress trips leading to the same grid point), of which only the
shortest one is preserved. The travel time of an egress connection is the
minimum travel time among all different modes that are present in the egress
table. The modes can be subsetted by setting the egress_modes
parameter,
e.g. egress_modes = "walk"
to include only egress times by foot. Possible
trips itself may be filtered as well, by setting a maximum allowed travel
time through the egress_limit
parameter.
For each destination grid point listed in the grid table of x
, the
shortest multi-modal travel time (as calculated in the step above) is
compared to the travel time of a single-modal direct trip listed in the
direct table of x
. The travel time of such a direct connection is the
minimum travel time among all different modes that are present in the
direct table. The modes can be subsetted by setting the direct_modes
parameter, e.g. direct_modes = "bike"
to include only direct times by
bicycle. Possible trips itself may be filtered as well, by setting a
maximum allowed travel time through the direct_limit
parameter. The
minimum between the multi-modal travel times and the single-modal travel
time is the returned shortest travel time from the selected origin grid
point to the destination grid point.
The grid table of the GTFS-Multi feed with an additonal column
containing for each grid point the calculated travel time from the given
origin location to that grid point. Grid points that could not be reached
get a travel time value of NA
. If iterate = TRUE
, there will be multiple
travel time columns instead of only one. Each column then represents the
travel time for a fixed departure time.
gtfsrouter::gtfs_traveltimes()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.