NMEA

From OpenStreetMap

Jump to: navigation, search

Your GPS receiver might record your tracks in NMEA format. This is true for the NaviGPS and for Neo1973 using gllin driver. If your GPS receiver logs in NMEA format, you will need to convert the NMEA files to GPX before you can use them with OpenStreetmap or Josm.

Contents

Uploading NMEA text dumps (web interface)

At http://richard.dev.openstreetmap.org/upload.cgi , you can upload your tracks in NMEA (or any other) format to OSM.

The script will use gpsbabel to convert your tracks to GPX, then upload them to the main server, saving you the effort!

Converting NMEA text dumps (with gpsbabel)

GPSBabel is a commonly used program to convert from one GPS format to another, and can convert from NMEA to GPX. You can use GPSBabel either as a GUI or a command-line program. If you set up GPSBabel as a command-line program using one of the following scripts, you will avoid wasting a lot of time clicking the graphical user interface.

GPSBabel can be used on the command line like:

gpsbabel -i nmea -f "nmeafilenmame" -o gpx -F "outputfilename.gpx"

NMEA sentences normally store all the data output by the gps including data which is poor. However this can easily be cleaned out by setting filtering options with GPSBabel. The most common need is to filter data which has poor horizontal accuracy due to a lack of satellite visibility or other signal performance issues. The hdop value in the NMEA sentence is used for this. Filtering for data better than 10 is a good compromise between filtering for accuracy but keeping sufficient points where the general quality of the log was poor. Adding the filter to the above command line entry gives:

gpsbabel -i nmea -f "nmeafilename" -x discard,hdop=10 -o gpx -F "outputfilename.gpx"

On GNU/Linux or other posix systems

Use the following bash script to convert multiple files from NMEA to GPX in one operation. Save it as gpxconvert then run it as ./gpxconvert *.TXT for batch mode or ./gpxconvert mynmeafile.TXT for single file mode. NickH

#!/bin/bash
if [ -z "$1" ] ; then
echo "Takes a list of inout NMEA files, converts to GPX files."
echo  "usage: ./gpxconvert <nmea_input_files>"
exit 0
fi
for file in "$@"; do
if [ ! -e "$file" ]; then
 echo "$file input file doesn't exist, Skipping."
else
 if [ -e "$file.gpx" ]; then
  echo "$file.gpx already exists. Skipping"
 else
  echo "$file.gpx - converting"
  gpsbabel -i nmea -f "$file" -o gpx -F "$file.gpx"
 fi
fi
done

The script will skip files where the output file already exists. If you have a folder where you upload your nmea files, you can just drag your new nmea files into the folder then run ./gpxconvert *.nmea (assuming .nmea is your file extension). It will only convert those which haven't yet been converted. You could also run this command as a desktop icon on GNU/Linux or windows. Drag your NMEA files to a folder, click a button then all your NMEA files have a GPX equivalent.

On Windows

Using navi-convert

I have made a batch conversion program which bundles the above script with the Free Software GPSbabel and Bash. Grab the bundle and follow step by step instructions from navi-convert NickH

Using the DOS CLI

Another easy solution is to put all your .nmea files in one single directory. You will need GPSBabel as well. Once this is done, open a DOS prompt, the go in this directory using cd and run the following command:

for %i in (*.TXT) do "<PATH_TO_GPABABEL>\gpsbabel.exe" -i nmea -f %i -o gpx -F %~ni.gpx

For me, <PATH_TO_GPSBABEL> is F:\Mac\GPSBabel\.

Using GPSBabel's GUI

Alternatively, you can use gpsbabel for windows, which provides a GUI. The GUI will likely be much slower to use if you have a number of files to convert. (hint: use the .zip file for windows).

If it doesn't work post some of the data to the mailing list and we will help you out.

Converting NMEA text dumps (with osmtrackfilter.pl)

osmtrackfilter.pl is one of the OSM perl scripts in svn and can convert from several common formats, including nmea and gpsdrive track files to gpx. It also has several helpful features including file reduction to remove duplicate points and date replacement.

Typical usage to remove date information, for privacy:

perl osmtrackfilter.pl --fake-gpx-date mytextfile.nmea

See the built-in help file for further information:

perl osmtrackfilter.pl -h

Gosmore NMEA to GPX conversion

Gosmore may just do a better job than other utilities when the data is damaged e.g. by communication errors. To do it you must create a 'fake' gpsd server :

nc -l -p 2947 <mytextfile.nmea &
./gosmore 
# Close the application and look for GPX file(s)

Describing what is what in NMEA

Some information sources:

NMEA message strings are in the form:

$GPAAM,A,A,0.10,N,Waypointname*checksum
$GPRMC,030102.653,A,3929.7,N,10506.6,W,0.14,135.42,100204,,*checksum
$GPGSA,A,3,11,19,07,08,4,17,24,,,,,,1.9,1.12,3.0*checksum

Where the chars following $GP and preceding then first "," i the message type. They contain diffrent sets of information, but the information is duplicated in diffrent commands, so you will get your position in many of these commands.

  • RMC is the recommended minimum sentence, it
  • GSA contains precision information (DOP)
  • GGA Global Positioning System Fix Data; can also contain DOP information (I think)
  • AAM alarm thingies..

e.g. I'm going to buy a GPS unit and it says "Commands: GGA, GSA, GSV, RMC, GLL och VTG"

  • GSV - Satellites in view
  • GLL - Geographic Position - Latitude/Longitude
  • VTG - Track made good and Ground speed. (Speed heading etc)

GGA

The fields are

  1. Time (UTC)
  2. Latitude
  3. N for northern hemisphere and S for southern
  4. longitude
  5. East or West of prime meridian
  6. Type of GPS fix, 0=none, 1=fix, 2=DGPS
  7. Num of Satelites used for fix
  8. HDOP. estimated error of position in the horizontal plane
  9. Altitude
  10. M=meters (unit of previous field)
  11. Geoidal separation
  12. M=meters (unit of previous field)
  13. DGPS channel

GSA

Data about what satelites we were using, and errors.

  1. xx
  2. type of fix: 1=none, 2=2D, 3=3D
  3. satelite IDs (lots of fields)
  4. PDOP (0-50 where 0 is good)
  5. HDOP
  6. VDOP
  7. Checksum
Personal tools
recent changes