From 510ff20d2065c70d8d2b1eae7a81f98ea9a6921f Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Wed, 2 Nov 2016 16:01:07 +0100 Subject: [PATCH] rs92,rs41,imet1ab,dfm,m10: output-log -> gpx,kml --- rs92/pos2gpx.pl | 11 +++++++++-- rs92/pos2kml.pl | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rs92/pos2gpx.pl b/rs92/pos2gpx.pl index 0301796..7e9ceb3 100755 --- a/rs92/pos2gpx.pl +++ b/rs92/pos2gpx.pl @@ -10,6 +10,7 @@ print "\n"; print "\n"; my $line; +my $date; my $hms; my $lat; my $lon; my $alt; @@ -17,14 +18,20 @@ print "\n"; print "\n"; while ($line = <$fh>) { - if ($line =~ /(\d\d:\d\d:\d\d).*\ lat:\ *(-?\d*\.\d*)\ +lon:\ *(-?\d*\.\d*)\ +alt:\ *(-?\d*\.\d*).*/) { + if ($line =~ /(\d\d:\d\d:\d\d\.?\d?\d?\d?).*\ +lat:\ *(-?\d*\.\d*)\ +lon:\ *(-?\d*\.\d*)\ +alt:\ *(-?\d*\.\d*).*/) { + $hms = $1; $lat = $2; $lon = $3; $alt = $4; + + $date = ""; + if ($line =~ /(\d\d\d\d-\d\d-\d\d).*/) { $date = sprintf ("%sT", $1); } + #if ($line =~ /(\d\d\d\d)-(\d\d)-(\d\d).*/) { $date = sprintf ("%04d-%02d-%02dT", $1, $2, $3); } + print " \n"; print " $alt<\/ele>\n"; - printf(" \n", $hms); + printf(" \n", $date, $hms); print " \n"; } } diff --git a/rs92/pos2kml.pl b/rs92/pos2kml.pl index 3dd11b3..4bff6ef 100755 --- a/rs92/pos2kml.pl +++ b/rs92/pos2kml.pl @@ -20,7 +20,7 @@ print " absolute\n"; print " \n"; print " "; while ($line = <$fh>) { - if ($line =~ /(\d\d:\d\d:\d\d).*\ lat:\ *(-?\d*\.\d*)\ +lon:\ *(-?\d*\.\d*)\ +alt:\ *(-?\d*\.\d*).*/) { + if ($line =~ /(\d\d:\d\d:\d\d).*\ +lat:\ *(-?\d*\.\d*)\ +lon:\ *(-?\d*\.\d*)\ +alt:\ *(-?\d*\.\d*).*/) { $hms = $1; $lat = $2; $lon = $3;