rs92,rs41,imet1ab,dfm,m10: output-log -> gpx,kml

pull/13/head
Zilog80 2016-11-02 16:01:07 +01:00
rodzic 53cdc1ded5
commit 510ff20d20
2 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -10,6 +10,7 @@ print "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n";
print "<gpx version=\"1.1\" creator=\"me\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.topografix.com/GPX/1/1\" xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\">\n";
my $line;
my $date;
my $hms;
my $lat; my $lon; my $alt;
@ -17,14 +18,20 @@ print "<trk>\n";
print "<trkseg>\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 " <trkpt lat=\"$lat\" lon=\"$lon\">\n";
print " <ele>$alt<\/ele>\n";
printf(" <time>%sZ</time>\n", $hms);
printf(" <time>%s%sZ</time>\n", $date, $hms);
print " </trkpt>\n";
}
}

Wyświetl plik

@ -20,7 +20,7 @@ print " <altitudeMode>absolute</altitudeMode>\n";
print " <coordinates>\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;