Function transit_model::transfers::generates_transfers
source · pub fn generates_transfers(
model: Model,
max_distance: f64,
walking_speed: f64,
waiting_time: u32,
need_transfer: Option<NeedTransfer<'_>>
) -> Result<Model>
Expand description
Generates missing transfers
The max_distance
argument allows you to specify the max distance
in meters to compute the tranfer.
The walking_speed
argument is the walking speed in meters per second.
The waiting_time
argument is the waiting transfer_time in seconds at stop.
need_transfer
Additional condition that determines whether a transfer
must be created between 2 stop points. By default transfers that do not
already exist and where the distance is less than max_distance
will be created.
If you need an additional condition, you can use this parameter. For instance
you could create transfers between 2 stop points of different contributors only.
WARNING: if geolocation of either StopPoint
is (0, 0), it’s considered
incorrect and transfer is not generated to or from this StopPoint
.
Example
from_stop_id | to_stop_id | transfer_time | |
---|---|---|---|
SP1 | SP2 | no time is specified, this transfer will be removed | |
SP3 | SP2 | 120 | transfer added |
UNKNOWN | SP2 | 180 | stop UNKNOWN is not found, transfer will be ignored |
UNKNOWN | SP2 | stop UNKNOWN is not found, transfer will be ignored |