ais-json-english

    0.1.2 • Public • Published

    AIS Logo

    ais-json-english

    ais-json-english

    A npm package about AIS (Automatic Identification System) text decoding.

    Originally forked from https://www.npmjs.com/package/ais-json

    Decode AIS text, then return JSON object.

    npm address: https://www.npmjs.com/package/ais-json-english

    Structure

    Name Description
    index.js main function (call decode.js and include verify ais text)
    encode.js generate ascii6bit.json and num2char.json
    decode.js decode ais text and return json (base on ascii6bit.json and num2char.json)
    ascii6bit.json connect ascii to 6 bit code
    num2char.json connect number to char

    Install

    npm install ais-json-english

    Usage

    In Terminal

    npx ais '!AIVDM,1,1,,A,15Cgah00008LOnt>1Cf`s6NT00SU,0*3D'

    Then, you will get:

    {
      "MessageID": {
        "name": "MessageID",
        "data": 1,
        "info": "Ship Position Report"
      },
      "DataIndicator": {
        "name": "Forward Indicator",
        "data": 0,
        "info": "Default"
      },
      "UserID": {
        "name": "UserID(MMSI)",
        "data": 356248000,
        "info": 356248000
      },
      "NaviStatus": {
        "name": "NavStatus",
        "data": 0,
        "info": "Under way using Engine"
      },
      "ROT": {
        "name": "ROT",
        "data": "0°/min",
        "info": "0°/min"
      },
      "SOG": {
        "name": "SOG",
        "data": "0 section",
        "info": "0 section"
      },
      "Accuracy": {
        "name": "Accuracy",
        "data": 0,
        "info": "High(<10m)"
      },
      "Location": {
        "name": "Coordinate",
        "data": [118.07354333333333, 24.502496666666666],
        "info": "E 118°4.4126′ , N 24°30.1498′"
      },
      "COG": {
        "name": "COG",
        "data": "228.4°",
        "info": "228.4°"
      },
      "Heading": {
        "name": "HDT",
        "data": "207°",
        "info": "207°"
      },
      "Second": {
        "name": "timestamp",
        "data": 18,
        "info": "18 seconds past the minute"
      },
      "RegionalApplication": {
        "name": "specific indicator",
        "data": 0,
        "info": "Unavailable"
      },
      "Spare": {
        "name": "spare",
        "data": 0,
        "info": "Unused"
      },
      "RAIM": {
        "name": "RAIM",
        "data": 0,
        "info": "RAIM not used"
      },
      "CommunicationState": {
        "name": "CommStatus",
        "data": "0000000100011100101",
        "info": "SOTDMA 4:57 UTC"
      },
      "text": "!AIVDM,1,1,,A,15Cgah00008LOnt>1Cf`s6NT00SU,0*3D"
    }

    In Project

    Decode AIS Text

    # const ais = require('ais-json-english') 
    import ais from 'ais-json-english'
    let aisinfo = ais('!AIVDM,1,1,,A,15Cgah00008LOnt>1Cf`s6NT00SU,0*3D')

    Open SerialPort

    If you need it.

    node-serialport

    cd ais-json-english
    node serialport

    Default

    Port: COM3
    BaudRate: 38400

    Encode Table

    cd ais-json-english
    node encode

    Generate ascii6bit.json and num2char.json.

    Intend

    • CLI

    Keywords

    Install

    npm i ais-json-english

    DownloadsWeekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    27.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar