Skip to content

AIS message encoding and decoding library built with scodec

Notifications You must be signed in to change notification settings

svroonland/scodec-ais

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scodec-ais

Scala AIS message encoding and decoding library built with scodec

About

A typesafe library for decoding AIS messages. Special missing values (like 511 for true heading) are decoded as Option values.

Currently a proof of concept, supporting decoding only of messages types 1, 2, 3, 5, 8, 18, 19, 21, 24, 27.

Usage

import nl.vroste.ais._

val nmeaMessage = "!AIVDM,1,1,,A,13aIgm0P00PCtV6MdbFIROvP2>`<,0*4E" // This is a position report

val decodedOrError: Either[Err, AisMessage] = AisMessa.decode(nmeaMessage)

decodedOrError match {
  case(Some(positionReport)) =>
    println(positionReport.courseOverGround) // Will print 244.1
}

See the unit tests for more examples.

Resources

About

AIS message encoding and decoding library built with scodec

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages