diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-11-09 18:17:05 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-11-09 18:17:05 +0100 |
commit | fd805597f5fc6ee2a58a0d040192f46d414c5ac6 (patch) | |
tree | c4b3ba52af146b047ce406e4c13e66a04f7a9e7a /lib | |
parent | d75ae5eb456cd7f67a021c827077559a0b41b032 (diff) |
HAFAS: filter out border stations
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travelynx/Helper/HAFAS.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index 78e1c8f..6d2f6d2 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -169,8 +169,13 @@ sub get_route_timestamps_p { [ $coord->{lon}, $coord->{lat} ] ); } } - my $iris_stations = join( '|', $opt{train}->route ); - my $hafas_stations = join( '|', @station_list ); + my $iris_stations = join( '|', $opt{train}->route ); + + # borders (Gr" as in "Grenze") are only returned by HAFAS. + # They are not stations. + my $hafas_stations + = join( '|', grep { $_ !~ m{(\(Gr\)|\)Gr)$} } @station_list ); + if ( $iris_stations eq $hafas_stations or index( $hafas_stations, $iris_stations ) != -1 ) { |