MyNav reader for gpsbabel

Posted on December 17, 2014. Tagged as:

Got a few GPS tracks this weekend. Some of them came as .trc or .ftn file (probably from a VDO GP7 device). Turns out that format is reasonably well documented. So I wrote a patch and submitted it to the gpsbabel project.

Here is a first prototype of a MyNav to GPX converter, which works as well:

#!/usr/bin/env ruby

puts '<?xml version="1.0" encoding="UTF-8"?>'
puts '<gpx version="1.0" creator="TRC converter"
  xmlns="http://www.topografix.com/GPX/1/0">'

puts '<trk>'
puts '<trkseg>'

STDIN.each do | line |
    type, longitude, latitude, direction, speed, altitude, timestamp, rest = line.split('|')
    if type == '1' && longitude != '0' && latitude != '0'
        time = Time.at(timestamp.to_i).strftime("%Y-%m-%dT%H:%M:%SZ")
        lat = latitude.to_i / 3600000.0
        lon = longitude.to_i / 3600000.0
        puts "<trkpt lat=\"#{lat}\" lon=\"#{lon}\">"
        puts "<ele>#{altitude}</ele>"
        puts "<time>#{time}</time>"
        puts '</trkpt>'
    end
end

puts '</trkseg>'
puts '</trk>'
puts '</gpx>'

Update (2014-12-17): The patch is in gpsbabel-trunk now.