mjaros / ais-decoder Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
sorry, Im sure I am missing something simple for this
this.destination = bitField.getString(320, 120); // Error
// correct
this.destination = bitField.getString(302, 120);
if (char != '@') {
stringValue += char;
}
Missing padding like this:
var checksumHex = checksum.toString(16).toUpperCase();
if (checksumHex.length == 1) checksumHex = '0' + checksumHex;
I'm experiencing an issue when parsing high volume satellite AIS data where the below error is being thrown:
Invalid part number '2' while decoding message type 24
This does appear to be relatively rare (maybe every million records I've receiving), but it seems to destroy the stream and there doesn't seem to be anything I can do to handle the error from my side (i.e. log and skip) as I'm receiving the following afterwards:
[ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
I'm aware part number should alway be 0 or 1, but unfortunately there isn't anything I can do about a faulty transmitter.
I've simply moved the switch
and if
statements in ais-decoder.ts into a try/catch to prevent destroying the stream but I figured I'd open an issue incase you have a more elegant solution or a reason to destroy the stream on this event.
import AisDecoder from "ais-stream-decoder" ;
const aisDecoder = new AisDecoder();
In the examples in the readme, this code is used to import and construct an AisDecoder.
upon running the script ($ node index.js)
An error is returned, "TypeError: AisDecoder is not a constructor"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.