HAFAS: filter out border stations

This commit is contained in:
Daniel Friesel 2022-11-09 18:17:05 +01:00
parent d75ae5eb45
commit fd805597f5
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -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 )
{