summaryrefslogtreecommitdiff
path: root/bin/db-iris
diff options
context:
space:
mode:
Diffstat (limited to 'bin/db-iris')
-rwxr-xr-xbin/db-iris16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/db-iris b/bin/db-iris
index 65f617b..b916579 100755
--- a/bin/db-iris
+++ b/bin/db-iris
@@ -148,6 +148,22 @@ sub get_station {
return $input_name;
}
+ if ( $input_name
+ =~ m{ ^ (?<lon> [[:digit:].]+ ) , (?<lat> [[:digit:].]+ ) }x )
+ {
+ my @candidates
+ = Travel::Status::DE::IRIS::Stations::get_station_by_location(
+ $+{lon}, $+{lat} );
+ say STDERR "Geolocation candidates for $+{lon},$+{lat} are:";
+ say STDERR join(
+ "\n",
+ map {
+ sprintf( "%s (%s) - %-3.1fkm", $_->[0][1], $_->[0][0], $_->[1] )
+ } @candidates
+ );
+ exit(1);
+ }
+
my @stations = Travel::Status::DE::IRIS::Stations::get_station($input_name);
if ( @stations == 0 ) {