Compressed Position Report Data Formats¶
In compressed data format, the Information field contains the station’s latitude and longitude, together with course and speed or pre-calculated radio range or altitude.
This information is compressed to minimize the length of the transmitted packet (and therefore improve its chances of being received correctly under less than ideal conditions).
The Information field also contains a display Symbol Code, and there may optionally be a plain text comment (uncompressed) as well.
The Advantages of Data Compression¶
Compressed data format may be used in place of the numeric lat/long coordinates already described, such as in the I/A and I/F formats.
Data compression has several important benefits:
- Fully backwards compatible with all existing formats.
- Fully supports any comment string.
- Speed is accurate to +/- 1 mph up to about 40 mph and within 3% at 600 mph.
- Altitude in feet is accurate to +/- 0.4% from 1 foot to 3000 miles.
- Consistent one-algorithm processing of compressed latitude and longitude.
- Improved position to 1 foot worldwide.
- Pre-calculated radio range, compressed to one byte.
- Potential 50% compression of every position format on the air.
- Potential 40% reduction of raw GPS NMEA data length.
- Additional 7-byte reduction for NEMA GGA altitudes.
- Support for TNC compression at the NMEA source (from the GPS receiver).
- Digipeater compression of old NMEA trackers on the fly.
- Usage is optional in all cases.
The only minor disadvantages are that the course only resolves to +/- 2 degrees, and this format does not support PHG.
Compressed Data Format
Compressed data may be generated in several ways:
- by APRS software.
- pre-entered manually into a digipeater’s beacon text.
- by a digipeater converting raw tracker NMEA packets to compressed.
[In future, there is the possibility that a Kantronics KPC-3 or other tracker TNC will be able to compress data directly from an attached GPS receiver].
In all cases the compressed format is a fixed 13-character field:
/YYYYXXXX$csT
where
/ is the Symbol Table Identifier
YYYY is the compressed latitude
XXXX is the compressed longitude
$ is the Symbol Code
cs is the compressed course/speed or
compressed pre-calculated radio range or
compressed altitude
T is the compression type indicator
| Sym Table ID | Compressed Lat YYYY | Compressed Long XXXX | Symbol Code | Compressed Course/Speed or Compressed Radio Range or Compressed Altitude | Comp Type T |
|---|---|---|---|---|---|
| Bytes: | 1 | 4 | 4 | 1 | 2 |
Compressed format can be used in place of lat/long position format anywhere that ...ddmm.hhN/ddmm.hhW$xxxxxxxx... occurs.
All bytes except for the / and $ are base-91 printable ASCII characters (![..{]). These are converted to numeric values by subtracting 33 from the decimal ASCII character code. For example, # has an ASCII code of 35, and represents a numeric value of 2 (i.e. 35-33).
Symbol
The presence of the leading Symbol Table Identifier instead of a digit indicates that this is a compressed Position Report and not a normal lat/long report.
Lat/Long Encoding¶
The values of YYYY and XXXX are computed as follows:
- YYYY is 380926 × (90 – latitude) [base 91]
-
Latitude is positive for north, negative for south, in degrees.
-
XXXX is 190463 × (180 + longitude) [base 91]
- Longitude is positive for east, negative for west, in degrees.
For example, for a longitude of 72° 45' 00" west (i.e., -72.75 degrees), the math is 190463 × (180 – 72.75) = 20427156. Because this is to base 91, it is then necessary to progressively divide this value by reducing powers of 91, to obtain the numerical values of x:
[ \begin{align} 20427156 / 91^3 & = 27, \text{ remainder } 80739 \ 80739 / 91^2 & = 9, \text{ remainder } 6210 \ 6210 / 91^1 & = 68, \text{ remainder } 22 \ \end{align} ]
To obtain the corresponding ASCII characters, 33 is added to each of these values, yielding 60 (i.e. 27+33), 42, 101, and 55. From the ASCII Code Table (in Appendix 3), this corresponds to *e7 for XXXX.
Lat/Long Decoding¶
To decode a compressed lat/long, the reverse process is needed. That is, YYYY is represented as y₁y₂y₃y₄ and XXXX as x₁x₂x₃x₄, then:
-
Lat = 90 - ((y₁-33) × 91³ + (y₂-33) × 91² + (y₃-33) × 91 + y₄-33) / 380926
-
Long = -180 + ((x₁-33) × 91³ + (x₂-33) × 91² + (x₃-33) × 91 + x₄-33) / 190463
For example, if the compressed value of the longitude is *e7 (as computed above), the calculation becomes:
[ \begin{align} \text{Long} & = -180 + (27 × 91³ + 9 × 91² + 68 × 91 + 22) / 190463 \ & = -180 + (20346417 + 74529 + 6188 + 22) / 190463 \ & = -180 + 107.25 \ & = -72.75 \text{ degrees} \ \end{align} ]
Course/Speed, Pre-Calculated Radio Range and Altitude¶
The two cS bytes following the Symbol Code character can contain either the compressed course and speed or the compressed pre-calculated radio range or the station’s altitude. These two bytes are in base 91 format.
In the special case of c = _ (space), there is no course, speed or range data, in which case the cST bytes are ignored.
Course/Speed¶
If the ASCII code for c is in the range ! to z inclusive — corresponding to numeric values in the range 0–89 decimal (i.e. after subtracting 33 from the ASCII code) — then cS represents a compressed course/speed value:
course = c × 4
speed = 1.08s − 1
For example, if the c s characters are 7P, the corresponding values of c and s (after subtracting 33 from the ASCII character code) are 22 and 47 respectively. Substituting these values in the above equations:
course = 22 × 4 = 88 degrees
speed = 1.0847 − 1 = 36.2 knots
Pre-Calculated Radio Range — If c = {, then c s represents a compressed pre-calculated radio range value:
range = 2 × 1.08s
For example, if the c s bytes are {?}, the ASCII code for ? is 63, so the value of s is 30 (i.e. 63-33). Thus:
range = 2 × 1.0830
~ 20 miles
So APRS will draw a circle of radius 20 miles around the station plot on the screen.
The CompressionType (T) Byte¶
The T byte follows the c s bytes. The T byte contains several bit fields showing the GPS fix status, the NMEA source of the position data and the origin of the compression.
The T byte is not meaningful if the c byte is ␣ (space).
| Bit: | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Not used | Not used | GPS Fix | NMEA Source | Compression Origin | ||||
| Value: | 0 | 0 | 0 = old (last) 1 = current | 00 = other 01 = GLL 10 = GGA 11 = RMC | 0 0 0 = Compressed 0 0 1 = TNC BText 0 1 0 = Software (DOS/Mac/Win+SA) 0 1 1 = [tbd] 1 0 0 = KK9C3 1 0 1 = Pico 1 1 0 = Other tracker [tbd] 1 1 1 = Digipeater conversion |
For example, if the compressed position was derived from an RMC sentence, the fix is current, and the compression was performed by APRSdos software, then the value of T in binary is 0 0 1 11 010, which equates to 58 decimal. Adding 33 to this value gives the ASCII code for the T byte (i.e. 91), which corresponds to the [ character.
Thus, using data from all the earlier examples, if the RMC sentence contains (among other parameters) the following data:
- Latitude = 49° 30' 00" north
- Longitude = 72° 45' 00" west
- Speed = 36.2 knots
- Course = 88°
and: - the fix is current - compression is performed by APRSdos software - the display symbol is a “car”
then the complete 13-character compressed location field is transmitted as:
/ YYYY XXXX $ c s T / 5L! ! * e7 > 7P I
Altitude¶
If the T byte indicates that the raw data originates from a GGA sentence (i.e. bits 4 and 3 of the T byte are 10), then the sentence contains an altitude value, in feet. After compression, the compressed altitude is placed in the cs bytes, such that:
altitude = 1.002 cs feet
For example, if the received cs bytes are s], the computation is as follows:
- Subtract 33 from the ASCII code for each character:
c= 83 - 33 = 50s= 93 - 33 = 60- Multiply
cby 91 and addsto obtaincs: cs= 50 x 91 + 60- = 4610
- Then altitude = 1.002 4610
- = 10004 feet
Trackers¶
Tracker firmware may compress GPS data directly to APRS compressed format. They would use the ! Data Type Indicator, showing that the position is real-time and that the tracker is not APRS-capable.
If the Position Report is not real-time, then the / Data Type Indicator can be used instead, so that the latest fix time may be included.
Compressed Report Formats
Compressed data is contained in the AX.25 Information field, in these formats:
Compressed Lat/Long Position Report Format — no Timestamp¶
| ! or = | Sym Table ID | Comp Lat YYYY | Comp Long XXXX | Symbol Code | Compressed Course/Speed Compressed Radio Range Compressed Altitude | Comp Type T | Comment (max 40 chars) |
|---|---|---|---|---|---|---|---|
| Bytes: | 1 | 1 | 4 | 4 | 1 | 2 | 1 |
Examples
-
=/5L! !<*e7>_sTComment
with APRS messaging. Note the!space character following the>Symbol Code, indicating that there is no course/speed, radio range or altitude. ThesTcharacters are fillers and have no significance here. -
=/5L! !<*e7>?P[
with APRS messaging, RMC sentence, with course/speed. -
=/5L! !<*e7>?{!
with APRS messaging, with radio range. -
=/5L! !<*e7>OS]S
with APRS messaging, GGA sentence, altitude.
Compressed Lat/Long Position Report Format — with Timestamp¶
| / or @ | Time DHM / HMS | Sym Table ID | Comp Lat YYYY | Comp Long XXXX | Symbol Code | Compressed Course/Speed Compressed Radio Range Compressed Altitude | Comp Type T | Comment (max 40 chars) |
|---|---|---|---|---|---|---|---|---|
| Bytes: | 1 | 7 | 1 | 4 | 4 | 1 | 2 | 1 |
Example
@092345z/5L! !<*e7>?{!
with APRS messaging, timestamp, radio range.