AIVDM/AIVDO AIS Message Parser

Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
http://www.aisparser.com/

The Automatic Identification System (AIS) allows ships to be tracked in realtime based on information transmitted by each ship. They are equipped with either a Class A or Class B AIS transponder which includes a GPS for accurate position and speed reporting. AIS receivers decode the transmitted information and output the data as AIVDM messages.

The structure of the AIVDM message is described in IEC 61993-2 and it is a variation of the NMEA 0183 sentence format that includes the raw data encoded in a 6-bit format. A Message 1 example looks like this:

    !AIVDM,1,1,,B,19NS7Sp02wo?HETKA2K6mUM20<L=,0*27

The meaning of each data element in the AIS messages is covered by the ITU M.1371 and IEC 62287 documents. These documents are available from the websites of these organizations:

To fully understand the data produced by this library you should read the above documents.

This library allows you to write programs that accept ASCII AIVDM or AIVDO messages and parse their packed 6-bit data into structures containging the message data. The general flow of a typical aisparser program would look like this:

This library is thread safe, all variables used are contained in the ais_state structure. To support multiple data streams all you need to do is used 2 different instances of ais_state.

To get started you should read the documentation on the vdm_parse.c module and look at the example code in the example directory of the source distribution.

Not all of the AIS fields are fully parsed. My philosophy is to get the raw data into a format that your code can easily deal with and to minimize the layers between your code and the raw data. This means that you will need a copy of the documents mentioned above to fully understand the results you will get from parsing messages.

eg. The sog field of a message 1,2,3 represents Speed Over Ground in 1/10th of a knot. In the message 1 structure it is stored as an int instead of dividing it by 10 and converting to a float. This allows you to do your own division of the raw value and minimizes potential errors.


Generated on Tue Aug 26 13:57:50 2008 for AIS Parser by  doxygen 1.5.2