MyNav reader for gpsbabel

Posted on December 17, 2014. Tagged as: gps

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"

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 ="%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>'

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

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