• Stars
    star
    201
  • Rank 194,491 (Top 4 %)
  • Language
    C++
  • License
    Other
  • Created about 14 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C++ decoder for Automatic Identification System for tracking ships and decoding maritime information

Introduction

https://travis-ci.org/schwehr/libais.svg?branch=master

Library for decoding maritime Automatic Identification System messages.

See Also

Automatic Identification System

Other open source AIS projects:

Building

Building with Python

$ python setup.py build
$ python setup.py install

Testing with Python

$ virtualenv ve
$ source ve/bin/activate
$ python setup.py test

Building with CMake

$ cmake .
$ make

Building with legacy Makefile

$ make -f Makefile-custom test

Usage

There are two interfaces to libais, one high-level iterator based one and a low-level fast C++ only one. The iterator based interface is accessed the following way:

import ais.stream
with open("file.nmea") as f:
    for msg in ais.stream.decode(f):
        print msg

To use the low-level C++ interface directly, you need to handle multi-line messages and padding yourself:

import ais
ais.decode('15PIIv7P00D5i9HNn2Q3G?wB0t0I', 0)
ais.decode('402u=TiuaA000r5UJ`H4`?7000S:', 0)
ais.decode('55NBjP01mtGIL@CW;SM<D60P5Ld000000000000P0`<3557l0<50@kk@K5h@00000000000', 2)

There is also support for converting parsed messages to the structure output by GPSD / gpsdecode. For full compatibility, you have to write the resulting message dictionaries to a file with json.dump() and add a newline after each message.

import ais.stream
import json
import ais.compatibility.gpsd

with open("infile.nmea") as inf:
    with open("outfile.gpsd") as outf:
        for msg in ais.stream.decode(f):
            gpsdmsg = ais.compatibility.gpsd.mangle(msg)
            json.dump(gpsdmsg, outf)
            outf.write("\n")

AIS Specification Documents

  • ITU-1371, ITU-1371-{1,2,3,4]
  • e-Navigation
  • IMO Circ 236
  • IMO Circ 289
  • EU RIS

Developing

The C++ code was switched to the Google style in November, 2012. Indenting should be by 2 spaces.

http://google-styleguide.googlecode.com/svn/trunk/cpplint/

$ git clone https://github.com/schwehr/libais
$ cd libais
$ virtualenv ve
$ source ve/bin/activate
$ pip install -e .[tests]
$ python setup.py test
$ py.test --cov=ais --cov-report term-missing

or

$ git clone https://github.com/schwehr/libais
$ cd libais
$ virtualenv ve
$ source ve/bin/activate
$ pip install -e .[test]
$ python setup.py develop
$ python setup.py test
$ py.test --cov=ais --cov-report term-missing

More Repositories

1

noaadata

Pure python AIS decode and encode
Python
44
star
2

Tracker-Component-Library

This is a collection of Matlab functions that are useful in the development of target tracking algorithms.
C
15
star
3

generic-sensor-format

Sonar Generic Sensor Format (gsf) codec
C
13
star
4

ais-area-notice

Reference library for the IMO Circ 289 AIS Binary Message for timed zone messages
Python
13
star
5

bag-py

Bathymetry Attributed Grids (BAG) utilities in python
Python
9
star
6

simplesegy

segy parsing in python
Python
8
star
7

mb-system-old

Multibeam sonar processing
C
5
star
8

research-tools

Introduction to scientific computing. Started in 2011 at the University of New Hampshire by Kurt Schwehr.
HTML
5
star
9

sioseis

manipulating marine seismic reflection and refraction data
Fortran
5
star
10

density

3D volumetric visualization tools. Heavily dependent on Coin/OpenInventor
Fortran
4
star
11

degrib

degrib starting with 2.03 (minus zlib libpng, jpeg2000 netcdf libxml gd)
C
3
star
12

mbreadsimrad

A bunch of code I wrote while taking taking Jonathan Beaudoin's short course on reading multibeam data. This code is released under the Apache 2 license
C++
3
star
13

gpsd

This is not an official gpsd repository
C
2
star
14

templates

Samples from many programming languages and config files
Emacs Lisp
2
star
15

tidetools

Python
2
star
16

caris-lidar

Parser for the CARIS CAF/CBF Lidar waveform format
Python
1
star
17

slogcxx

C++ logging library for debugging and tracing. Meant to be quick to learn.
C
1
star
18

pfmabe

Army Corps of Engineers (ACOE) Pure File Magic (PFM) point editor (US Government public domain code)
C++
1
star
19

xsonar

Sidescan sonar processing
C
1
star
20

macframegrab

Capture a single image from a camera on the Mac (fork of ImageSnap by Robert Harder)
Objective-C
1
star