Class NmeaReader

  • All Implemented Interfaces:
    IGpxReader

    public class NmeaReader
    extends java.lang.Object
    implements IGpxReader
    Reads a NMEA 0183 file. Based on information from https://gpsd.gitlab.io/gpsd. NMEA files are in printable ASCII form and may include information such as position, speed, depth, frequency allocation, etc. Typical messages might be 11 to a maximum of 79 characters in length. NMEA standard aims to support one-way serial data transmission from a single "talker" to one or more "listeners". The type of talker is identified by a 2-character mnemonic. NMEA information is encoded through a list of "sentences".
    • Constructor Detail

      • NmeaReader

        public NmeaReader​(java.io.InputStream source)
                   throws java.io.IOException
        Constructs a new NmeaReader
        Parameters:
        source - NMEA file input stream
        Throws:
        java.io.IOException - if an I/O error occurs
    • Method Detail

      • getParserUnknown

        public int getParserUnknown()
        Number of unknown sentences
        Returns:
        return the number of unknown sentences encountered
      • getParserZeroCoordinates

        public int getParserZeroCoordinates()
        Number of empty coordinates
        Returns:
        return the number of coordinates which have been zero
      • getParserChecksumErrors

        public int getParserChecksumErrors()
        Number of checksum errors
        Returns:
        return the number of sentences with checksum errors
      • getParserMalformed

        public int getParserMalformed()
        Number of malformed errors
        Returns:
        return the number of malformed sentences
      • parse

        public boolean parse​(boolean tryToFinish)
                      throws java.io.IOException
        Description copied from interface: IGpxReader
        Parse the GPX data.
        Specified by:
        parse in interface IGpxReader
        Parameters:
        tryToFinish - true, if the reader should return at least part of the GPX data in case of an error.
        Returns:
        true if file was properly parsed, false if there was error during parsing but some data were parsed anyway
        Throws:
        java.io.IOException - if any I/O error occurs