Menu

Data Structure

Andrew Daviel

Data Structure of Garmin ADM files

(This is derived from examination of exported user data from just one device - a GPSmap 546 - not from Garmin documentation or from reverse engineering software - so it is incomplete and probably inaccurate.)

All byte addresses are given in decimal starting at zero. Other numbers are
given in decimal, or hex (e.g. 0x32)

The first 512 bytes contain a file header or preamble.
Starting at byte 16, the word 'GARMIN' in ASCII.
Starting at byte 73, the word 'USERDATA' in ASCII.
At bytes 57-63, the creation date and time as YYMDHMS as separate binary values
At byte 98, a flag that gives the block units. For a value n, the block unit is 512*2^n bytes.
The header contains other control bytes, at e.g. address 10, 28, 100 and others.
At some byte addresses 512*n+1, the words 'USERDATATRK', 'USERDATAWPT',
'USERDATARTE' and optionally 'USERDATAPRX', corresponding to track, waypoint,
route and proximity data.
Immediately following each of those marker words, a 32-bit value giving the length of
the corresponding datablock, in bytes.
At the marker word address plus 31, the datablock base address given in block units.
At the end of the datablock (base address + length - 4), two checksum bytes. The first
byte is the arithmetic sum of all bytes in the block, modulo 256, less 11.

For the waypoint data block, starting at the WPT base address:
A 2-byte word of zero.
A 32-bit word giving the length of the entire block.
At the base address plus 33, a 16-bit word giving the number of waypoints
At the base address plus 51, an 8-bit word giving the length of the waypoint name field.
At the base address plus 55, an 8-bit word giving the length of the waypoint comment field.

The total waypoint record length is 24 plus the two variable-length fields, giving a
fixed length used for all waypoint records in the file.

The proximity data block header is the same.

Following the waypoint block header, the waypoint records start at the base address plus 78.
Each waypoint record consists of a 32-bit latitude, 32-bit longitude,name,comment,
16-bit symbol number,32-bit depth,32-bit temperature and 32-bit date.
Latitude and longitude are given as signed binary fractions of 360 degrees.
Depth and temperature are 32-bit floating point values. Time is given in seconds since
midnight on 13 December 1989, UTC.
The symbol numbers are semi-sparse integers with symbols for common marine icons
in the low numbers, e.g. 1 is 'Anchor', 5 is code flag 'A', diver down. 18 is the default
generic 'Waypoint' symbol.

Data recorded by the GPS set may not include all the fields. Sets with no depthsounder
will not record depth or temperature.

For the route data block, starting at the RTE base address:
A 2-byte word of zero.
A 32-bit word giving the length of the entire block.
At the base address plus 37, a 16-bit word giving the offset to the start of route records.
At the base address plus 41, a 16-bit word giving the number of routes.
At the base address plus 47, a 16-bit word giving the length of the route name field.
At the base address plus 71, a 16-bit word giving the length of the routepoint name field.
At the base address plus 75, a 16-bit word giving the length of the routepoint comment field.
At the base address plus 91, a second 16-bit word giving the length of the routepoint name field.
For each route record, a route name.
Following the name, a 32-bit word giving the number of routepoints, followed
by routepoint records.
Each routepoint record consists of a 32-bit latitude, 32-bit longitude,name,comment,
and time in the same format as for waypoints.
The total record length is 44 plus the length of both names and comment
Each new route record of N routepoints starts 8 bytes after the previous record.
For some routepoint records saved from hardware, the record length is fixed at 246 bytes,
the comment and time fields are empty, and the name field is at byte 53.

For the track data block, starting at the TRK base address:
A 2-byte word of zero.
A 32-bit word giving the length of the entire block.
A 2-byte word of zero.
At the base address plus 41, a 16-bit word giving the number of tracks.
At the base address plus 47, a 16-bit word giving the length of the track name field.
Track records start at the base address plus 89.
For each track record, a track name.
Following the name, a 16-bit word giving the number of trackpoints, followed by trackpoint records. ADM does not support track segments; there is just one TRKSEG per TRK.
Each trackpoint record consists of a 32-bit latitude, 32-bit longitude,and 32-bit time.
ADM does not support names, elevations or other values for trackpoints.
For tracks recorded live by the GPSmap546 (identified 'ACTIVE LOG'), each trackpoint has a time record. For tracks subsequently saved to named objects, timestamps are lost and the value is zero or negative.
Each new track record of N trackpoints starts 8 bytes after the previous record.