Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svroonland/scodec-ais
AIS message encoding and decoding library built with scodec
https://github.com/svroonland/scodec-ais
ais scala scodec
Last synced: 21 days ago
JSON representation
AIS message encoding and decoding library built with scodec
- Host: GitHub
- URL: https://github.com/svroonland/scodec-ais
- Owner: svroonland
- Created: 2019-09-08T10:02:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T06:00:20.000Z (11 months ago)
- Last Synced: 2024-11-10T22:42:46.536Z (3 months ago)
- Topics: ais, scala, scodec
- Language: Scala
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# scodec-ais
Scala AIS message encoding and decoding library built with [scodec](http://scodec.org/)# 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
```scala
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](https://github.com/svroonland/scodec-ais/blob/master/src/test/scala/nl/vroste/ais/AisCodecSpec.scala) for more examples.
# Resources
* [AIVDM/AIVDO protocol decoding](https://gpsd.gitlab.io/gpsd/AIVDM.html)