Minimal binary representation for GPS data focused on file size while still maintaining precision (0.67cm lat and 1.34cm long at the Equator)
-
All values are Big Endian
-
Files should use the
.bgpxfile extension -
Floats are IEEE 754 Singles
-
Fixed-Point sign uses Q-Format
-
No byte-padding, values are the exact size as stated
Example:
Q8.24 = 8 bits for signed integer, 24 bits for fractional part
UQ9.23 = 9 bits for unsigned integer, 23 bits for fractional part
Both of these examples use 32 bits in total
| Field | Type | Size | Description |
|---|---|---|---|
| File Header | Magic | 32 bits |
Always 0x42 0x47 0x50 0x58 |
| Version | Unsigned Integer | 32 bits |
Currently 1094 |
| Field | Type | Size | Description |
|---|---|---|---|
| Start of Track | Magic | 32 bits |
Always 0x54 0x52 0x4B 0x53 |
| TLS | Unsigned Integer | 2 bits |
Track List Size in bits = (Value+1)*8 |
| Track Type | Unsigned Integer | 2 bits |
0 = Ordered Track, 1 = Unordered Track, 2 = Ordered Area, automatically connects the first and last waypoint |
| Track Color | Unsigned Integer | 4 bits |
Color Index [0 ≤ 15] |
| Waypoint Count | Unsigned Integer | TLS bits |
Number of total waypoints |
| Waypoint Data | 32 bytes each waypoint |
If Track type is "Unordered" then additional info is added, "Ordered" Track Types don't include this:
| Field | Type | Size | Description |
|---|---|---|---|
| Connection Count | Unsigned Integer | TLS bits |
Number of total connections between waypoints |
| Connection Data | TLS*2 each connection |
| Field | Type | Size | Description |
|---|---|---|---|
| Point A Index | Unsigned Integer | TLS bits |
|
| Point B Index | Unsigned Integer | TLS bits |
| Field | Type | Size | Description |
|---|---|---|---|
| Latitude* | Fixed-Point Q8.24 |
32 bits |
Degrees [-90 ≤ 90] WGS84 datum |
| Longitude* | Fixed-Point Q9.23 |
32 bits |
Degrees [-180 ≤ 180] WGS84 datum |
| Altitude | Floating-Point IEEE 754 | 32 bits |
Meters |
| Heading | Fixed-Point UQ9.23 |
32 bits |
Degrees [0 ≤ 360] |
| H. Accuracy | Floating-Point IEEE 754 | 32 bits |
Meters |
| V. Accuracy | Floating-Point IEEE 754 | 32 bits |
Meters |
| Timestamp* | Unsigned Integer | 64 bits |
Milliseconds since 00:00:00 01/01/1970 UTC Time |
"*" = Required
Optional Fixed-Point fields are omitted when equal to
0xFFFFFFFF'sOptional Floating-Point fields are omitted when
NaN
42 47 50 58 00 00 04 46
54 52 4B 53 93 00 00 01
20 EE E5 1A CF 81 F6 8D
42 FA 99 9A FF FF FF FF
40 79 99 9A 7F C0 00 00
00 00 01 99 2C 23 83 88
42 47 50 58 00 00 04 46
| Hex | Description |
|---|---|
42 47 50 58 |
Header Magic Number |
00 00 04 46 |
Version (1094) |
54 52 4B 53 93 00 00 01
| Hex | Description |
|---|---|
54 52 4B 53 |
Track Start Magic Number |
93 |
Track Flags |
> 0b10 |
Track List Size (24 bits) |
> 0b01 |
Track Type ("Ordered") |
> 0b0011 |
Track Color ("Red") |
00 00 01 |
Waypoint Count (1) |
20 EE E5 1A CF 81 F6 8D 42 FA 99 9A FF FF FF FF 40 79 99 9A 7F C0 00 00 00 00 01 99 2C 23 83 88
| Hex | Description |
|---|---|
20 EE E5 1A |
Latitude (32.93318331241608 degrees) |
CF 81 F6 8D |
Longitude (-96.98466336727142 degrees) |
42 FA 99 9A |
Altitude (125.3 meters) |
FF FF FF FF |
Heading (Omitted) |
40 79 99 9A |
Horizontal Accuracy (3.9 meters) |
7F C0 00 00 |
Vertical Accuracy (Omitted) |
00 00 01 99 2C 23 83 88 |
64-bit UNIX Timestamp (1757382149000 milliseconds) (Tue Sep 09 2025 01:42:29 UTC+0000) |