NMEA.jl is a package for parsing NMEA GPS protocol sentences
N.B. I've just "adopted" this package from the original author. If you have any thoughts about improving the design, or if you'd like to contribute, please let me know.
example = NMEA.parse(raw"$GPGGA,134740.000,5540.3248,N,01231.2992,E,1,09,0.9,20.2,M,41.5,M,,0000*61")
println(example.latitude)
stores data for last parsed sentence of all NMEA message types
Global Positioning System Fix Data
GNSS DOP and Active Satellites
Time and Date
RAIM GNSS Satellite Fault Detection
Geographic Position - Latitude/Longitude
GNSS Satellites in View
Recommended Minimum Specific GNSS Data
Course over Ground and Ground Speed
Datum
Inertial attitude data - source
parses NMEA line/sentence and stores data in NMEAData; returns message type
The following example reads and parses a file of NMEA data line by line and displays GGA and GSV data
NMEA
function display_GGA(m::GGA)
println("==================================================")
println("=============== ESSENTIAL FIX DATA ===============")
println("System: $(get(m.system))")
println("Time Of Day (UTC): $(get(m.time)) secs")
println("Latitude: $(get(m.latitude))")
println("Longitude: $(get(m.longitude))")
println("Fix Quality: $(get(m.fix_quality))")
println("Tracked Satellites: $(get(m.num_sats))")
println("HDOP: $(get(m.HDOP))")
println("Altitude (MSL): $(get(m.altitude)) m")
println("Geoidal Seperation: $(get(m.geoidal_seperation)) m")
println("==================================================\n")
end # function display_GGA
# initialize/construct
nmea = NMEAData()
# read file line by line
fh = open("testdata.txt", "r")
for line = readlines(fh)
# parse each line (sentence) in NMEA file and return message type
mtype = parse_msg!(nmea, line)
# display GGA and GSV data
if (mtype == "GGA")
display_GGA(nmea.last_GGA)
else
continue
end
end
Output
==================================================
=============== ESSENTIAL FIX DATA ===============
System: GPS
Time Of Day (UTC): 50632.0 secs
Latitude: 55.675155555555556
Longitude: 12.519430555555557
Fix Quality: GPS (SPS)
Tracked Satellites: 9
HDOP: 0.9
Altitude (MSL): 5.6 m
Geoidal Seperation: 41.5 m
==================================================
...