View Single Post
  #3  
Old April 27th 04, 06:41 PM
Mark A. Matthews
external usenet poster
 
Posts: n/a
Default

In article ,
Chris Davison wrote:

Anyone know of any software that will take a downloaded
Garmin tracklog and convert it into a .igc file (non
secure) so that it can be fed into Seeyou or tasknav
etc for viewing and analysis purposes?


Some perl hackery that will do the job - it's not pretty, but it works:
Modify as necessary, salt to taste.

Pipe the garmin data to standard in, redirect stdout to a file.

#!/usr/bin/perl -w

print "HFDTE070204\n";
print "HFFXA050\n";
print "HFPLTPILOT:Nobody\n";
print "HFGTYGLIDERTYPE:\n";
print "HFGIDGLIDERID:N2EE\n";
print "HFDTM100GPSDATUM:WGS84\n";
print "HFFTYFRTYPE:GARMIN,GPS-III\n";
print "HFRFWFIRMWAREVERSION:2.4.1\n";
print "HFRHWHARDWAREVERSION:10A817O963WP\n";
print "HFGPS:,,12,\n";
print "HFCIDCOMPETITIONID:\n";
print "HFCCLCOMPETITIONCLASS:\n";
print "HFSITSITE:\n";
print "HFTZNTIMEZONE:-8\n";

while() {
chop;
($trackNum, $dateStr, $latStr, $lonStr) = split(/\t/);

if ($trackNum != 1) {
next;
}

($month, $day, $year, $hh, $mm, $ss) = split(/[\/\s:]/, $dateStr);

($latDeg, $latMin, $latSec) = split(/[d']/, $latStr);
chop($latSec);
$latMin = ($latMin * 1000) + ($latSec * 1000) / 60;

($lonDeg, $lonMin, $lonSec) = split(/[d']/, $lonStr);
chop($lonSec);
$lonMin = ($lonMin * 1000) + ($lonSec * 1000) / 60;

printf("B%2.2d%2.2d%2.2d%2.2d%5.5d%s%3.3d%5.5d%sV0 000000000\n",
$hh, $mm, $ss, abs($latDeg), $latMin, ($latDeg 0 ? "N" : "S"),
abs($lonDeg), $lonMin, ($lonDeg = 0 ? "E" : "W"));
}

--
-Mark