summaryrefslogtreecommitdiff
path: root/lib/Travel/Routing
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-14 13:07:49 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-14 13:07:49 +0200
commitb6c48e211c4ef0512a97fe07f675747cfc3ff363 (patch)
tree773ea8455ddcb260c1016978ff210bf71f492b8a /lib/Travel/Routing
parent34c8e23fbb16c249fc7b09289cf90f76c375501f (diff)
Add train_product accessor to Route/Part and use it in bin/efa
Diffstat (limited to 'lib/Travel/Routing')
-rw-r--r--lib/Travel/Routing/DE/EFA.pm1
-rw-r--r--lib/Travel/Routing/DE/EFA/Route/Part.pm14
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/Travel/Routing/DE/EFA.pm b/lib/Travel/Routing/DE/EFA.pm
index 801270b..562c0e9 100644
--- a/lib/Travel/Routing/DE/EFA.pm
+++ b/lib/Travel/Routing/DE/EFA.pm
@@ -594,6 +594,7 @@ sub parse_xml_part {
departure_stop => $e_dep->getAttribute('name'),
departure_platform => $e_dep->getAttribute('platformName'),
train_line => $e_mot->getAttribute('name'),
+ train_product => $e_mot->getAttribute('productName'),
train_destination => $e_mot->getAttribute('destination'),
arrival_date => $self->itddate_str($e_adate),
arrival_time => $self->itdtime_str($e_atime),
diff --git a/lib/Travel/Routing/DE/EFA/Route/Part.pm b/lib/Travel/Routing/DE/EFA/Route/Part.pm
index 8c46fb9..e6c6e18 100644
--- a/lib/Travel/Routing/DE/EFA/Route/Part.pm
+++ b/lib/Travel/Routing/DE/EFA/Route/Part.pm
@@ -13,7 +13,7 @@ Travel::Routing::DE::EFA::Route::Part->mk_ro_accessors(
arrival_date arrival_time arrival_sdate arrival_stime delay
departure_platform
departure_stop departure_date departure_time departure_sdate
- departure_stime train_line train_destination
+ departure_stime train_destination train_line train_product
)
);
@@ -219,11 +219,19 @@ newline-terminated strings
=item $part->train_destination
-destination of the line providing the connection
+Destination of the line providing the connection. May be empty.
=item $part->train_line
-name / number of the line
+Name / number of the line. May be empty.
+
+=item $part->train_product
+
+Usually the prefix of B<train_line>, for instance C<< U-Bahn >> or
+C<< Niederflurstrab >>. However, it may also contain special values such as
+C<< FuE<szlig>weg >> (for a direct connection without transit vehicles) or
+C<< nicht umsteigen >> (in case a vehicle changes its line number at a stop).
+In those cases, B<train_destination> and B<train_line> are usually empty.
=item $part->via