From d40b2e698f7cd82f1cec8fbedc228f9da5cd9c28 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 4 Feb 2023 17:54:02 +0100 Subject: HAFAS: station: add names und uics accessors --- lib/Travel/Status/DE/HAFAS.pm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 706727c..9b3bcce 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -703,8 +703,10 @@ sub station { if ($loc) { $self->{station_info} = { - name => $loc->{name}, - uic => $loc->{extId}, + name => $loc->{name}, + uic => $loc->{extId}, + names => [ map { $locL[ $_->[0] ]{name} } @prefcounts ], + uics => [ map { $locL[ $_->[0] ]{extId} } @prefcounts ], }; } else { @@ -949,13 +951,14 @@ service messages. Each message belongs to at least one arrival/departure. =item $status->station -Returns a hashref describing the most common departure station in all requested -journeys. Note that this may be different from the station for which departures -were requested, as HAFAS uses different identifiers for train stations, bus -stops, and other modes of transit even if they are interlinked. +Returns a hashref describing the departure stations in all requested journeys. +The hashref contains four entries: B (station names), B (most +common name), B (UIC / EVA IDs), and B (most common UIC / EVA ID). +These are subject to change. -The hashref contains two entries: B (station name) and B (UIC / EVA -ID). These are subject to change. +Note that the most common name and ID may be different from the station for +which departures were requested, as HAFAS uses different identifiers for train +stations, bus stops, and other modes of transit even if they are interlinked. Not available in journey mode. -- cgit v1.2.3