Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 46 additions & 16 deletions README
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
AIS Parser SDK v1.10
Copyright 2006-2014 by Brian C. Lane <bcl@brianlane.com>
AIS Parser SDK v1.11.0
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All Rights Reserved
See LICENSE for licensing information


This is the first public release of the AIS Parser SDK. I have re-licensed it under the BSD license. See LICENSE for details. This code will now be available at https://github.com/bcl/aisparser/

NOTE: This codebase is now fairly old, I personally do not use it for anything
but am willing to accept pull requests with bugfixes and reasonably targeted
changes.

'C' Version:
AIS Parser SDK source is in ./c/src/
Expand All @@ -22,15 +23,20 @@ Linux Python is in ./python/linux/
OSX Python is in ./python/osx/
Win32 Python is in ./python/win32/

I have removed the pre-compiled Python versions because they were out of date. You can rebuild them on your system by running the buildit script in their respective directories.
I have removed the pre-compiled Python versions because they were out of date.
You can rebuild them on your system by running the buildit script in their
respective directories.

Win32 DLL built using Visual Studio 6 is in ./dll/aisparser
Visual Basic 6 example is in ./dll/examples
This version does not include a pre-compiled DLL. I no longer support Windows as a development environment so you will need to build your own.

This version does not include a pre-compiled DLL. I no longer support Windows
as a development environment so you will need to build your own.


AIS Parser SDK source
---------------------

The core parser consists of 12 files, 6 .c files and their associated .h files:

nmea.c/nmea.h - functions for processing NMEA 0183 sentences.
Expand All @@ -43,6 +49,7 @@ access.c/access.h - helper functions for python and Visual Basic

St. Lawrence Seaway
-------------------

The parser code for St. Lawrence seaway binary messages is in the seaway.c file. The
seawayX_X messages have been tested against the examples in the Seaway documentation.
the pawssX_X messages have not been tested.
Expand All @@ -55,7 +62,9 @@ The St. Lawrence Seaway message specification is in ./c/docs/StLawrence.pdf

IMO Binary Messages
-------------------
The parser code for IMO binary messages is in the imo.c and imo.h files. The imoX_X messages have not yet been tested against real data.

The parser code for IMO binary messages is in the imo.c and imo.h files. The
imoX_X messages have not yet been tested against real data.

If someone has access to live IMO Binary messages that I could use in testing, I would
appreciate it if you would forward them to me at bcl@brianlane.com
Expand All @@ -77,7 +86,10 @@ parses messages with position information and outputs a JSON (JavaScript)
data structure for use with the Google Maps demo webpage. There is also a
simple XML version and a text output version.

Parsing St. Lawrence Seaway and IMO binary messages are more complicated than the other messages. You must first parse the mssage 8 or 6, and then pass its data payload to the appropriate seaway/imo parser function to extract all of the information.
Parsing St. Lawrence Seaway and IMO binary messages are more complicated than
the other messages. You must first parse the message 8 or 6, and then pass its
data payload to the appropriate seaway/imo parser function to extract all of
the information.


Python
Expand All @@ -87,10 +99,16 @@ around the SDK's 'c' source. Structures are implemented as classes in
Python, and all of the SDK's functions are exposed via the Python interface.

Check the ./python/example/ directory for examples of how to use the Python
module. There is a wxPython GUI application that will read a log file and display the details of the messages. There is also last_ais.py which I use to generate my dynamic
email signature, capturing the latest ship info from my local receiver.
module. There is a wxPython GUI application that will read a log file and
display the details of the messages. There is also last_ais.py which I use to
generate my dynamic email signature, capturing the latest ship info from my
local receiver.

The runme.py example in the swig directory can also be used. It has an example of parsing a Seaway 1.3 message. In python the struct arrays are not properly understood by the SWIG wrapper, so the helper function that matches the message must be used to first extract the array element before Python can operate on it.
The runme.py example in the swig directory can also be used. It has an example
of parsing a Seaway 1.3 message. In python the struct arrays are not properly
understood by the SWIG wrapper, so the helper function that matches the message
must be used to first extract the array element before Python can operate on
it.

Package can be directly pip installed with recent setuptools:

Expand All @@ -100,18 +118,30 @@ Package can be directly pip installed with recent setuptools:

Windows DLL
-----------

There is a Windows DLL, including source, in ./dll/aisparser
It was compiled using Visual Studio 6, and does not work with .NET or any of the new Visual tools that I am aware of. There is an example VB6 application in the ./dll/examples directory.

The Visual Basic example form code show how to use all of the normal parsing functions. I have attempted to add parsing of the IMO and St. Lawrence Seaway messages to it, including adding helper functions (which are also used by python), but I have been unable to convince Visual Basic to correctly recognize the data structures. So, for now, parsing all of the normal AIS messages works fine in VB6, but IMO and Seaway parsing doesn't work.
It was compiled using Visual Studio 6, and does not work with .NET or any of
the new Visual tools that I am aware of. There is an example VB6 application in
the ./dll/examples directory.

The Visual Basic example form code show how to use all of the normal parsing
functions. I have attempted to add parsing of the IMO and St. Lawrence Seaway
messages to it, including adding helper functions (which are also used by
python), but I have been unable to convince Visual Basic to correctly recognize
the data structures. So, for now, parsing all of the normal AIS messages works
fine in VB6, but IMO and Seaway parsing doesn't work.


Delphi
------
Thanks to Chris Krohn for allowing me to include his Delphi port of the parser. This does not include the St. Lawrence Seaway parser code. It can be found in ./contrib/AISParser.pas

Thanks to Chris Krohn for allowing me to include his Delphi port of the parser.
This does not include the St. Lawrence Seaway parser code. It can be found in
./contrib/AISParser.pas

If you have any comments, questions, problems, etc. Please contact me and I'll get back to you as soon as I can. I appreciate feedback of any kind.

email - bcl@brianlane.com
If you have any comments, questions, problems, etc. Please contact me and I'll
get back to you as soon as I can. I appreciate feedback of any kind.

email - bcl@brianlane.com
2 changes: 1 addition & 1 deletion c/examples/json/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Makefile for ais_json example
#
# Copyright 2006 by Brian C. Lane <bcl@brianlane.com>
# Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
# All Rights Reserved
#
# Please note that this Makefile *needs* GNU make. BSD make won't do.
Expand Down
2 changes: 1 addition & 1 deletion c/examples/json/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
Process AIS messages read from stdin and output JSON structure
Copyright 2006 by Brian C. Lane
Copyright 2006-2025 by Brian C. Lane
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/examples/text/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Makefile for ais_text
#
# Copyright 2006 by Brian C. Lane <bcl@brianlane.com>
# Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
# All Rights Reserved
#
# Please note that this Makefile *needs* GNU make. BSD make won't do.
Expand Down
2 changes: 1 addition & 1 deletion c/examples/text/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
Process AIS messages read from stdin and output readable text fields
Copyright 2006 by Brian C. Lane
Copyright 2006-2025 by Brian C. Lane
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/examples/xml/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Makefile for xml example program
#
# Copyright 2006 by Brian C. Lane <bcl@brianlane.com>
# Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
# All Rights Reserved
#
# Please note that this Makefile *needs* GNU make. BSD make won't do.
Expand Down
2 changes: 1 addition & 1 deletion c/examples/xml/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
Process AIS messages read from stdin and output an XML structure
Copyright 2006 by Brian C. Lane
Copyright 2006-2025 by Brian C. Lane
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/src/access.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK
Copyright 2006-20078 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/src/access.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */

Expand Down
4 changes: 2 additions & 2 deletions c/src/imo.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK IMO Binary Data Parsing
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand All @@ -14,7 +14,7 @@

/*! \file
\brief IMO Binary Message Parsing
\author Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\author Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\version 1.0

For exact definitions of each field you should see the IMO SN/Circ. 236
Expand Down
2 changes: 1 addition & 1 deletion c/src/imo.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
IMO Binary Message Data Header
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */

Expand Down
4 changes: 2 additions & 2 deletions c/src/nmea.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
NMEA 0183 Sentence Parsing
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand All @@ -12,7 +12,7 @@

/*! \file
\brief NMEA 0183 Sentence Parser Module
\author Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\author Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\version 1.8

This module provides utility functions for handling NMEA 0183 data
Expand Down
2 changes: 1 addition & 1 deletion c/src/nmea.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
Header file for NMEA string parser
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All Rights Reserved
----------------------------------------------------------------------- */
/*! \file
Expand Down
4 changes: 2 additions & 2 deletions c/src/seaway.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK St. Lawrence Seaway Data Parsing
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand All @@ -14,7 +14,7 @@

/*! \file
\brief St. Lawrence Seaway Message Parsing
\author Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\author Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\version 1.0

For exact definitions of each field you should see the ITU M.1371,
Expand Down
2 changes: 1 addition & 1 deletion c/src/seaway.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
St. Lawrence Seaway Message Data Header
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */

Expand Down
4 changes: 2 additions & 2 deletions c/src/sixbit.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
6-bit packed ASCII functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand All @@ -11,7 +11,7 @@

/*! \file
\brief 6-bit packed ASCII functions
\author Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\author Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\version 1.8

This module's functions are used to extract data from the 6-bit packed
Expand Down
2 changes: 1 addition & 1 deletion c/src/sixbit.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
6-bit packed ASCII functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com
All Rights Reserved
----------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion c/src/test_access.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/src/test_access.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
void test_access( void );
2 changes: 1 addition & 1 deletion c/src/test_nmea.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
NMEA 0183 Sentence Parsing Test Module
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/src/test_nmea.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
Header file for NMEA string parser
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All Rights Reserved
----------------------------------------------------------------------- */
/*! \file
Expand Down
4 changes: 2 additions & 2 deletions c/src/test_seaway.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
AIS Parser SDK St. Lawrence Seaway Test functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand All @@ -16,7 +16,7 @@

/*! \file
\brief St. Lawrence Seaway Test functions
\author Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\author Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>, All Rights Reserved
\version 1.0

This module contains functions to test the St. Lawrence Seaway
Expand Down
2 changes: 1 addition & 1 deletion c/src/test_seaway.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
libuais vdm/vdo sentence parsing Test functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion c/src/test_sixbit.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
6-bit packed ASCII Test functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com
All Rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/src/test_sixbit.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
6-bit packed ASCII Test functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com
All Rights Reserved
----------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion c/src/test_vdm_parse.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
libuais VDM/VDO sentence parser Test functions
Copyright 2006-2019 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion c/src/test_vdm_parse.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
libuais vdm/vdo sentence parsing Test functions
Copyright 2006-2008 by Brian C. Lane <bcl@brianlane.com>
Copyright 2006-2025 by Brian C. Lane <bcl@brianlane.com>
All rights Reserved
----------------------------------------------------------------------- */

Expand Down
Loading