08 Sep 2009
Tue, 08 Sep 2009
There does not seem to be a public specification of the binary trk format for GPS waypoints used by Fugawi navigation products. So I sat down and compared the exported csv waypoints with the binary format. Following is the specification. All fields are little endian encoded.
The file starts with a 36 byte header of which little is known. The first 6 bytes contain the string FUGTRK, bytes 7 and 8 are always 0xffff. Bytes 12 and 13 contain the number of records in the file.
After the header are the waypoint records, 48 bytes each. Each records contains the following fields (again little endian!):
|8||4||32-bit float||Distance to last waypoint|
|24||8||64-bit double||Latitude WGS84|
|32||8||64-bit double||Longitude WGS84|
|40||8||64-bit double||Days since 1899-30-12 00:00:00 UTC, fractional part is the time in seconds of the day divided by 86400.|
Here is an example application which can convert trks to gpx or kml format
gcc fugawi.c -o fugawi # output debug info ./fugawi test.trk # output gpx ./fugawi test.trk gpx # output kml ./fugawi test.trk kmlUse at your own rist