Travel::Status::DE::HAFAS::Journey - Information about a single journey received by Travel::Status::DE::HAFAS
for my $departure ($status->results) { printf( "At %s: %s to %s from platform %s\n", $departure->datetime->strftime('%H:%M'), $departure->line, $departure->destination, $departure->platform, ); } # or (depending on module setup) for my $arrival ($status->results) { printf( "At %s: %s from %s on platform %s\n", $arrival->datetime->strftime('%H:%M'), $arrival->line, $arrival->origin, $arrival->platform, ); }
version 6.15
Travel::Status::DE::HAFAS::Journey describes a single journey. It is either a station-specific arrival/departure obtained by a stationboard query, or a train journey that does not belong to a specific station.
stationboard-specific accessors are annotated with "(station only)" and return undef for non-station journeys. All date and time entries refer to the backend time zone (Europe/Berlin in most cases) and do not take local time into account; see tz_offset for the latter.
Journey or line name, either in a format like "Bus SB16" (Bus line SB16) or "RE 10111" (RegionalExpress train 10111, no line information). May contain extraneous whitespace characters.
Type of this journey, e.g. "S" for S-Bahn, "RE" for Regional Express or "STR" for tram / Straßenbahn.
Long type of this journey, e.g. "S-Bahn" or "Regional-Express".
An integer identifying the the mode of transport class. Semantics depend on backend, e.g. "1" and "2" for long-distance trains and "4" and "8" for regional trains.
Journey or line name, either in a format like "Bus SB16" (Bus line SB16), "RE 42" (RegionalExpress train 42) or "IC 2901" (InterCity train 2901, no line information). May contain extraneous whitespace characters. Note that this accessor does not return line information for IC/ICE/EC services, even if it is available. Use line_no for those.
Line identifier, or undef if it is unknown. The line identifier may be a single number such as "11" (underground train line U 11), a single word (e.g. "AIR") or a combination (e.g. "SB16"). May also provide line numbers of IC/ICE services.
Journey number (e.g. train number), or undef if it is unknown.
HAFAS-internal journey ID.
DateTime object indicating the actual arrival/departure date and time. undef if no real-time data is available.
DateTime object indicating the scheduled arrival/departure date and time. undef if no schedule data is available.
DateTime object indicating the arrival/departure date and time. Real-time data if available, schedule data otherwise. undef if neither is available.
Offset between backend time zone (default: Europe/Berlin) and this journey's time zone in minutes, if any. For instance, if the backend uses UTC+2 (CEST) and the journey uses UTC+1 (IST), tz_offset is -60. Returns undef if both use the same time zone (or rather, the same UTC offset).
Delay in minutes, or undef if it is unknown. Also returns undef if the arrival/departure has been cancelled.
True if the journey's stop at the requested station is an unscheduled addition to its route.
True if the journey was cancelled, false otherwise.
True if part of the journey was cancelled, false otherwise.
Travel::Status::DE::HAFAS::Product(3pm) instance describing the product (mode
of transport, line number / ID, operator, ...) associated with this journey.
Note that journeys may be associated with multiple products -- see also
$journey->route
and $stop->product
.
Travel::Status::DE::HAFAS::Product(3pm) instance describing the product associated with stop (name or EVA ID). Returns undef if product or stop are unknown.
Actual arrival/departure platform. undef if no real-time data is available.
Scheduled arrival/departure platform. undef if no scheduled platform is available.
Arrival/Departure platform. Real-time data if available, schedule data otherwise. May be undef.
True if the real-time platform is known and it is not the scheduled one.
Expected passenger load (i.e., how full the vehicle is) at the requested stop. If known, returns a hashref that maps classes (typically FIRST/SECOND) to load estimation numbers. The DB backend uses 1 (low to medium), 2 (high), 3 (very high), and 4 (exceptionally high, train is booked out). Undef if unknown.
List of Travel::Status::DE::HAFAS::Message(3pm) instances related to this journey. Messages usually are service notices (e.g. "missing carriage") or detailed delay reasons (e.g. "switch damage between X and Y, expect delays").
The operator responsible for this journey. Returns undef if the backend does not provide an operator. Note that the operator may change along the journey -- in this case, the returned operator depends on the backend and appears to be the first one in most cases.
List of all operators observed along the journey.
Name of the station at which this journey was requested.
UIC/EVA ID of the station at which this journey was requested.
List of Travel::Status::DE::HAFAS::Stop(3pm) objects that describe individual stops along the journey. In stationboard mode, the list only contains arrivals prior to the requested station or departures after the requested station. In journey mode, it contains the entire route.
Up to count (default: 3) parts of $journey->route
that may
be particularly helpful, e.g. main stations or airports.
Name of the last route station. In arrival mode, this is where the train started; in all other cases, it is the terminus.
Alias for route_end; only set when requesting departures in station mode.
Alias for route_end; only set when requesting arrivals in station mode.
Train direction; this is typically the text printed on the train itself. May be different from destination / route_end and may change along the route, see above.
List of geocoordinates that describe the train's route. Only available if the HAFAS object constructor was passed a true with_polyline value. Each list entry is a hash with the following keys.
Note that stop locations in polyline may differ from the coordinates returned in route. This is a backend issue; Travel::Status::DE::HAFAS simply passes the returned coordinates on.
None.
None known.
Travel::Status::DE::HAFAS(3pm).
Copyright (C) 2015-2023 by Birte Kristina Friesel <derf@finalrewind.org>
This module is licensed under the same terms as Perl itself.