Travel::Routing::DE::HAFAS::Connection::Section - A single trip between two stops
# $connection is a Travel::Routing::DE::HAFAS::Connection object for my $sec ( $connection->sections ) { if ($sec->type eq 'JNY') { printf("%s -> %s\n%s ab %s\n%s an %s\n\n", $sec->journey->name, $sec->journey->direction, $sec->dep->strftime('%H:%M'), $sec->dep_loc->name, $sec->arr->strftime('%H:%M'), $sec->arr_loc->name, ); } }
version 0.09
Travel::Routing::DE::HAFAS::Connection::Section describes a single section between two stops, which is typically a public transit trip or a walk. It is part of a series of sections held by Travel::Routing::DE::HAFAS::Connection(3pm).
Some accessors depend on the section type. Those are annotated with the types in which they are valid and return undef when called in other contexts.
True if the arrival at the end of this section has been cancelled. False otherwise.
DateTime(3pm) object holding the arrival time and date. Based on real-time data if available, falls back to schedule data otherwise.
Arrival delay in minutes. Undef if unknown.
Travel::Status::DE::HAFAS::Location(3pm) object describing the arrival stop.
Arrival platform as string, not necessarily numeric. Undef if unknown.
True if the departure at the start of this section has been cancelled. False otherwise.
DateTime(3pm) object holding the departure time and date. Based on real-time data if available, falls back to schedule data otherwise.
Departure dlay in minutes. Undef if unknown.
Travel::Status::DE::HAFAS::Location(3pm) object describing the departure stop.
Transfer or walking distance in meters. Does not take vertical elevation changes into account.
DateTime::Duration(3pm) oobject holding the estimated transfer or walk duration. Typically assumes a slow pace.
Travel::Status::DE::HAFAS::Journey(3pm) instance describing the journey (mode of transport, intermediate stops, etc.).
Maximum expected occupancy along this section. Returns a hashref with keys FIRST and SECOND; each value ranges from 1 (low occupancy) to 4 (fully booked). Returns undef if occupancy data is not available.
List of Travel::Status::DE::HAFAS::Message(3pm) objects associated with this connection section. Typically contains messages related to the mode of transport, such as construction sites, Wi-Fi availability, and the like.
DateTime(3pm) object holding real-time arrival if available. Undef otherwise.
DateTime(3pm) object holding real-time departure if available. Undef otherwise.
DateTime(3pm) object holding scheduled arrival if available. Undef otherwise.
DateTime(3pm) object holding scheduled departure if available. Undef otherwise.
DateTime::Duration(3pm) object holding the difference between the departure of this journey and the arrival of the previous journey in the connection -- i.e., the amount of time available for changing platforms. May be negative. Undef for the first journey in a connection.
Type of this section as exposeed by the HAFAS backend. Known types: JNY (a public transit journey), TRSF (unspecified local transit), and WALK (walking).
None.
DateTime::Duration(3pm), Travel::Routing::DE::HAFAS::Utils(3pm).
None known.
Travel::Routing::DE::HAFAS(3pm), Travel::Routing::DE::HAFAS::Connection(3pm).
Copyright (C) 2023 by Birte Kristina Friesel <derf@finalrewind.org>
This program is licensed under the same terms as Perl itself.