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
| Offset | type | bytes | description | default/example |
|---|---|---|---|---|
| 0x0000 | String | 16 | TK1 Fileformat identifier, null terminated | |
| 0x0010 | Float | 4 | Hardware version | 1.1 |
| 0x0014 | Float | 4 | Software version | 1.305 |
| 0x0018 | Float? | 4 | Log format version? | 1 |
| 0x001C | Int32 | 4 | Unknown..., but 0x41BF1000 seems to work | 0x41BF1000 |
| 0x0020 | Int | 4 | Total number of points | 9987 |
| 0x0024 | Float? | 4 | Null? | |
| 0x0028 | String | 40 | Name of gps device, null padded | WBT201 |
| 0x0050 | String | 40 | Serialnumber of gps device, null padded | YYMM1234567890 |
| 0x0078 | String | 20 | Date and time of read out, null terminated | 2007_12_19_12:07:47\0 |
| 0x008C | Int | 4 | Offset of end of data block in bytes (decimal) | 160816 |
| 0x0090 | Int32 | 4 | Number of tracks | 25 |
| 0x0094 | ?? | 876 | Null 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:
| Offset | type | bytes | description | default/example |
|---|---|---|---|---|
| 0 | bitmask | 2 | Flags | 0000 0001 0000 0000 |
| 2 | time | 4 | Timestamp | 521198371 |
| 6 | Int32 | 4 | Latitude * 10.000.000 | 525152016 |
| 10 | Int32 | 4 | Longitude * 10.000.000 | 54818666 |
| 14 | Int16 | 2 | ALtitude | 16 |
The flags are as follows:
Flags && 0x01 => Track start Flags && 0x02 => Waypoint Flags && 0x04 => OverspeedThe 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.
| Offset | type | bytes | description | default/example |
|---|---|---|---|---|
| 0 | Int32 | 4 | Track number | 1 |
| 4 | Int32 | 4 | Offset in file | 0x0400 0000 |
| 8 | Int32 | 4 | Number of points in track | 397 |
| 12 | Int32 | 4 | Time | 3374 |
| 16 | Double | 8 | Distance/1000 in TK2 units = slightly more than km... | 0.022 |
