Package org.openstreetmap.josm.io.nmea
Class NmeaParser
java.lang.Object
org.openstreetmap.josm.io.nmea.NmeaParser
Parses NMEA 0183 data. Based on information from
https://gpsd.gitlab.io/gpsd.
NMEA data is 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".
- Since:
- 18787
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumGlobal Positioning System Fix Data.(package private) static enumGeographic Position - Latitude/Longitude.(package private) static enumGNSS DOP and Active Satellites.(package private) static enumGST - GNSS Pseudorange Noise Statistics(package private) static enumRecommended Minimum Specific GNSS Data.(package private) static enumCourse Over Ground and Ground Speed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected Stringprotected Stringprotected WayPointprivate static final DateTimeFormatterNMEA defines time with "a variable number of digits for decimal-fraction of seconds"protected intprotected intprotected Collection<WayPoint>protected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGet rid of older data no longer needed, drops everything except current coordinateReturn list of collected coordinates and drop old data When parsing a stream the last entry may be still incomplete and usually will not be droppedintNumber of checksum errorsintNumber of malformed errorsintNumber of unknown sentencesintNumber of empty coordinatesintNumber of successful coordinatesList of collected coordinates When parsing a stream the last entry may be still incomplete(package private) static booleanisSentence(String address, Sentence formatter) Determines if the given address denotes the given NMEA sentence formatter of a known talker.private static LatLonparseLatLon(String ns, String ew, String dlat, String dlon) booleanParses split up sentences into WayPoints which are stored in the collection in the NMEAParserState object.
-
Field Details
-
RMC_TIME_FMT
NMEA defines time with "a variable number of digits for decimal-fraction of seconds" -
waypoints
-
pTime
-
pDate
-
pWp
-
success
-
malformed
-
checksumErrors
-
noChecksum
-
unknown
-
zeroCoord
-
-
Constructor Details
-
NmeaParser
public NmeaParser()Constructs a newNmeaParser
-
-
Method Details
-
getParserUnknown
Number of unknown sentences- Returns:
- the number of unknown sentences encountered
-
getParserZeroCoordinates
Number of empty coordinates- Returns:
- the number of coordinates which have been zero
-
getParserChecksumErrors
Number of checksum errors- Returns:
- the number of sentences with checksum errors
-
getParserMalformed
Number of malformed errors- Returns:
- the number of malformed sentences
-
getSuccess
Number of successful coordinates- Returns:
- the number of successfully read coordinates
-
getWaypoints
List of collected coordinates When parsing a stream the last entry may be still incomplete- Returns:
- the collection of points collected
-
getAndDropWaypoints
Return list of collected coordinates and drop old data When parsing a stream the last entry may be still incomplete and usually will not be dropped- Returns:
- the collection of points collected
-
dropOldWaypoints
Get rid of older data no longer needed, drops everything except current coordinate -
isSentence
Determines if the given address denotes the given NMEA sentence formatter of a known talker.- Parameters:
address- first tag of an NMEA sentenceformatter- sentence formatter mnemonic code- Returns:
trueif theaddressdenotes the given NMEA sentence formatter of a known talker
-
parseNMEASentence
Parses split up sentences into WayPoints which are stored in the collection in the NMEAParserState object.- Parameters:
s- data to parse- Returns:
trueif the input made sense,falseotherwise.- Throws:
IllegalDataException
-
parseLatLon
-