Skip to content
Thomas Borg Salling edited this page Nov 14, 2015 · 23 revisions

Welcome to the aismessages wiki!

Introduction

AISmessages is a simple Java jar utility to decode AIS messages in NMEA format to machine-readable form. I.e. it converts messages like these:

!AIVDM,1,1,,A,18UG;P0012G?Uq4EdHa=c;7@051@,0*53
!AIVDM,1,1,,A,Dh3Ovk0nIN>4,0*38

into Java objects with easily accessible properties, like this one:

public class PositionReport extends DecodedAISMessage {
    ...
    public final NavigationStatus getNavigationStatus() { ... }
    public final Integer getRateOfTurn() { ... }
    public final Float getSpeedOverGround() { ... }
    public final Float getLatitude() { ... }
    public final Float getLongitude() { ... }
    ...
}

Getting the binaries

AISmessages is available in the Maven Central repository. Just add this dependency to your maven pom.xml file:

   <dependency>
      <groupId>dk.tbsalling</groupId>
      <artifactId>aismessages</artifactId>
      <version>1.08</version>
   </dependency>

or visit Maven Central for details on how to easily include AISmessages with other build tools.

Live demo

A live demo of AISmessages is available on http://ais.tbsalling.dk.

An online RESTful webservice based on AISmessages is available on http://ais.tbsalling.dk/api. This can be called online from your own applications to convert encoded AIS messages into JSON objects - and is free for non-commercial use.

Features

AISmessages

  • supports all 27 standard AIS message types
  • has no jar-dependencies beyond the JVM
  • is 100% pure Java
  • minimal coding to be in AIS business
  • is light-weight - no superfluous classes
  • high performant -- fully decodes 50000+ position reports per second on a 2.6 GHz Intel Core i7 MacBook -- decodes single field of 125000+ position reports per second on a 2.6 GHz Intel Core i7 MacBook

Sample usage code

AISmessages comes with three different classes to receive NMEA encapsulated AIS messages; one of them - the NMEAMessageSocketClient - demonstrates the simplicity by connecting to a TCP/IP socket and starting to receive and decode AIS messages:

public class SocketDemoApp implements DecodedAISMessageHandler {
    public void handleMessageReceived(DecodedAISMessage message) {
        System.out.println("AIS: " + message);
    }

    public void runDemo() {
        try {
            NMEAMessageSocketClient nmeaMessageHandler = new NMEAMessageSocketClient("207.7.148.216", 9009, this);
            nmeaMessageHandler.run();
        } catch (UnknownHostException e) {
            System.err.println("Unknown host: " + e.getMessage());
        } catch (IOException e) {
            System.err.println("I/O error: " + e.getMessage());
        }
    }

    public static void main(String[] args) {
        SocketDemoApp demoApp = new SocketDemoApp();
        demoApp.runDemo();
    }
}

Credits

Credits to Eric S. Raymond for producing valuable input to this work, in form of his AIVDM/AIVDO protocol decoding post http://gpsd.berlios.de/AIVDM.html.

Releases

1.00 Initial release - fully working. 1.08 Bug fix release

Known bugs

None.

Related work

Keywords

NMEA 0183, ITU 1371, ITU 1371.1, AIS, VDM, AIVDM, VDO, AIVDO, IMO.

Other relevant sites

Commercial license ?

If you are looking for a commercial and royalty-free license then write to Thomas Borg Salling - tbsalling(a)tbsalling.dk.

Questions or comments ?

Write to Thomas Borg Salling - tbsalling(a)tbsalling.dk.