npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ais-decoder

v1.3.5

Published

GEOGATE-geojson handles AIS/NMEA encoding/decoding for GEOgate GPS/AIS/GTS framework

Downloads

25

Readme

GeoGate

GeoGate is an opensource GPS/AIS tracking server framework, that enable easy integration of multiple GPS trackers in WEB applications. It provides data acquisition drivers for typical tracker devices or phone's GPS apps. It handle multiple database backend, and support GeoJSON, AIS & NMEA encoding/decoding. It embed support for multiple classes of trackers, phone-apps, as well an NMEA & AIS simulator.

GeoGate-Encoder [ggencoder]

Is the component that support AIS & NMEA encoding decoding for GeoGate. This component is fully independent of GeoGate and can be use without any other references to GeoGate

Install

  npm install ggencoder

  note: ./bin/Ais2JsonClient cli depends on async & jison but encoder/decoder themself do not depend on anything

Cli Usage

  node ./node_modules/.bin/Ais2JsonClient --verbose --hostname=localhost --port=5001

API Usage

  // import GeoGate encoding/decoding NMEA/AIS methods
  var AisEncode  = require ("ggencoder").AisEncode;
  var AisDecode  = require ("ggencoder").AisDecode;
  var NmeaEncode = require ("ggencoder").NmeaEncode;
  var NmeaDecode = require ("ggencoder").NmeaDecode;

  // decode and AIS message
  var decMsg = new AisDecode ("!AIVDM,2,1,1,A,55?MbV02;H;s<HtKR20EHE:0@T4@Dn2222222216L961O5Gf0NSQEp6ClRp8,0*1C");
  if (decMsg.valid) console.log ('%j', decMsg);

  // encode AIS message
  var encMsg = new AisEncode ({// class AB static info
        msgtype    : 24,
        part       : 2,
        mmsi       : 271041815,
        cargo      : 60,
        callsign   : "TC6163",
        dimA       : 0,
        dimB       : 15,
        dimC       : 0,
        dimD       : 5
  }); if (encMsg.valid) console.log (encMsg.nmea);

  // decode NMEA message
  var decMsg = new NmeaDecode ('$GPGGA,064036.289,4836.5375,N,00740.9373,E,1,04,3.2,200.2,M,,,,0000*0E');
  if (decMsg.valid) console.log ('%j', decMsg);

  // encode NMEA message
  encMsg = new NmeaEncode ({ // standard class B Position report
         msgtype    : 18,
         cog        : 72.2,
         sog        : 6.1000000000000005,
         lon        : 122.47338666666667,
         lat        : 36.91968,
  }); if (encMsg.valid) console.log (encMsg.nmea);

test

  cd test
  node --use_strict AisEncodeDecodeTest.js
  node --use_strict NmeaEncodeDecodeTest.js