Giter VIP home page Giter VIP logo

nmea's Introduction

NMEA

NMEA 0183 is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments

The following data text:

$GPGGA,130232.000,4529.9178,N,00913.9201,E,1,06,
1.35,133.5,M,48.0,M,,*68
$GPGSA,A,3,30,13,28,20,
05,15,,,,,,,1.63,1.35,0.92*02
$GPGSV,3,1,12,13,8
4,343,21,28,54,066,26,15,51,301,11,20,40,268,23*
77
$GPGSV,3,2,12,05,28,198,25,30,25,069,22,24,17
,264,19,17,12,127,*71
$GPGSV,3,3,12,07,03,074,,0
8,02,022,,19,01,146,,46,,,*4F
$GPRMC,130232.000
,A,4529.9178,N,00913.9201,E,0.40,260.06,100218,,,
A*6F
$GPVTG,260.06,T,,M,0.40,N,0.75,K,A*39

will be easily parsed with this java code:

import com.clickntap.nmea.NMEA;
import com.clickntap.nmea.NMEAUtils;
import com.clickntap.nmea.Position;

...

NMEA nmea = new NMEA();
JSONObject json = nmea.parse(text);
Position position = NMEAUtils.parsePosition(json);

The Output JSON:

{
  "messages": [
    "$GPGGA,104734.000,4529.9248,N,00913.9249,E,2,06,1.50,110.3,M,48.0,M,0000,0000*67",
    "$GPGSA,A,3,30,05,09,07,13,28,,,,,,,1.75,1.50,0.90*0C",
    "$GPRMC,104734.000,A,4529.9248,N,00913.9249,E,0.53,241.11,120218,,,D*67",
    "$GPVTG,241.11,T,,M,0.53,N,0.98,K,D*38"
  ],
  "items": [
    {
      "fixQuality": 2,
      "altitude": 110.3,
      "altitudeMetric": "M",
      "code": "GGA",
      "latitude": 45.498747,
      "horizontalDilutionOfPosition": 1.5,
      "geoidalMetric": "M",
      "numberOfSatellites": 6,
      "time": "104734.000",
      "longitude": 9.232082,
      "geoidal": 48
    },
    {
      "mode": "3",
      "code": "GSA",
      "automatic": "A"
    },
    {
      "date": "120218",
      "code": "RMC",
      "latitude": 45.498747,
      "speedKnots": 0.53,
      "time": "104734.000",
      "validity": "A",
      "trackMadeGood": 241.11,
      "longitude": 9.232082
    },
    {
      "code": "VTG",
      "speedKnots": 0.53,
      "trackMadeGood": 241.11,
      "speedKmPerHours": 0.98
    }
  ],
  "info": {
    "date": "120218",
    "altitude": 110.3,
    "latitude": 45.498747,
    "speedKnots": 0.53,
    "numberOfSatellites": 6,
    "time": "104734.000",
    "longitude": 9.232082,
    "speedKmPerHours": 0.98
  }
}

The interpreted sentences are:

  • $GPGGA - Global Positioning System Fix Data
  • $GPGSA - GPS DOP and active satellites
  • $GPGSV - GPS Satellites in view
  • $GPRMC - Recommended minimum specific GPS/Transit data
  • $GPVTG - Track made good and ground speed

But it's really easy to add a new interpreter.

Use with Maven

<dependency>
  <groupId>com.clickntap</groupId>
  <artifactId>nmea</artifactId>
  <version>1.0</version>
</dependency>

Support or Contact

Having trouble with NMEA API 1.x? Contact [email protected] and we’ll help you sort it out.

nmea's People

Contributors

tmendici avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.