-
Notifications
You must be signed in to change notification settings - Fork 67
Home
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() { ... }
...
}
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.
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.
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
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 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.
1.00 Initial release - fully working. 1.08 Bug fix release
None.
- AISutils - https://github.com/tbsalling/aisutils
NMEA 0183, ITU 1371, ITU 1371.1, AIS, VDM, AIVDM, VDO, AIVDO, IMO.
- AIVDM/AIVDO protocol decoding post - http://catb.org/gpsd/AIVDM.html
- GNU AIS - http://gnuais.sourceforge.net/
- Arundale AIS - http://web.arundale.co.uk/docs/ais/ais_decoder.html
- AIS Decoding - http://rl.se/ais_eng
- Jamsignal - http://jamsignal.blogspot.com/2009/05/free-ais-message-decoder.html
- AIS Online Decoder - http://www.aggsoft.com/ais-decoder.htm
- AIS Parser SDK - http://www.aisparser.com/, https://github.com/bcl/aisparser/
- AISTrack SDK - http://www.aistrack.com/page/products/aistrack-sdk/
If you are looking for a commercial and royalty-free license then write to Thomas Borg Salling - tbsalling(a)tbsalling.dk.
Write to Thomas Borg Salling - tbsalling(a)tbsalling.dk.