blank

TK1 specification

A TK1 file is made up of a 1024 bytes header followed by the data and ends with some binary garbage. The files are little endian, so pay attention on non-intel machines or java.

Header

Offsettypebytesdescriptiondefault/example
0x0000String16TK1 Fileformat identifier, null terminated
0x0010Float 4Hardware version1.1
0x0014Float 4Software version1.305
0x0018Float? 4Log format version?1
0x001CInt32 4Unknown..., but 0x41BF1000 seems to work0x41BF1000
0x0020Int 4Total number of points9987
0x0024Float? 4Null?
0x0028String40Name of gps device, null paddedWBT201
0x0050String40Serialnumber of gps device, null paddedYYMM1234567890
0x0078String20Date and time of read out, null terminated2007_12_19_12:07:47\0
0x008CInt 4Offset of end of data block in bytes (decimal)160816
0x0090Int32 4Number of tracks25
0x0094?? 876Null padding

Data

The data block consists of records, one per point. Each record is 16 bytes long, so the size of the data block should be:
Size data block = Total number of points * 16

The offset of the end of the data block is 1024 + Size data block bytes + 1. A record has the following fields:
Offsettypebytesdescriptiondefault/example
0bitmask 2Flags0000 0001 0000 0000
2time 4Timestamp521198371
6Int32 4Latitude * 10.000.000525152016
10Int32 4Longitude * 10.000.00054818666
14Int16 2ALtitude16

The flags are as follows:

Flags && 0x01 => Track start
Flags && 0x02 => Waypoint
Flags && 0x04 => Overspeed
The last point seems to be duplicated with an invald flag.

The datasection is ended with a list of track information, each track takes 24 bytes.

Offsettypebytesdescriptiondefault/example
0Int32 4Track number1
4Int32 4Offset in file0x0400 0000
8Int32 4Number of points in track397
12Int32 4Time3374
16Double 8Distance/1000 in TK2 units = slightly more than km...0.022