Purpose of document:

To introduce a script package incorporating the excellent gpsbabel to simplify batch conversion of nmea files to GPX on Microsoft Windows.

Summary:

GPSbabel has an excellent front end to convert files individually from one GPS format to another. However, if you have lots of, or regularly generate NMEA files to convert, you will spend a lot of time selecting input filename, output filename, input and output formats in the GPSbabel front end. This pakage dispenses with all that, making conversion of your new NMEA files to GPX a mouse click away.

This package was initially inspired watching people using naviGPS units converting their fles to GPX for use with Openstreetmap one by one. This package offers batch conversion of only those files which haven't already been converted. A far more efficient method..

How does the package work?

It consists of a single zip file containing the BASH command line interpreter (source, a bash script, a GPSBabel binary (source and a directory tree.

Package Contents:

/navi-convert.zip
/navi-convert/nmea.TXT
/navi-convert/gps
/navi-convert/navi-convert.bat
/navi-convert/programs/gpsbabel/COPYING
/navi-convert/programs/gpsbabel/libexpat.dll
/navi-convert/programs/gpsbabel/README.magnav
/navi-convert/programs/gpsbabel/README.psp
/navi-convert/programs/gpsbabel/README.xmapwpt
/navi-convert/programs/gpsbabel/README.mapconverter
/navi-convert/programs/gpsbabel/README.igc
/navi-convert/programs/gpsbabel/README.gui
/navi-convert/programs/gpsbabel/README.contrib
/navi-convert/programs/gpsbabel/AUTHORS
/navi-convert/programs/gpsbabel/gpsbabel.html
/navi-convert/programs/gpsbabel/gpsbabel.exe
/navi-convert/programs/nmea2gpx
/navi-convert/programs/copyright.txt
/navi-convert/programs/windows-bash.exe
/navi-convert/HOW-TO-USE.txt

How to use

NOTE: This package is for Microsoft Windows. See using with Linux below if using Linux.
  1. Download navi-convert to your desktop
  2. Unzip the package either by right clicking then selecting "extract here" or use freezip
  3. Open the navi-convert folder by double clicking on it
  4. Drag navi-convert.bat to the desktop using your RIGHT mouse button. When you let go, you will get a small menu. Select "make link here"

Now it's installed, when you copy NMEA files from your GPS unit, always put them in
Desktop\navi-convert\nmea.TXT
You can use the folder as your archive. When you double click navi-convert.bat, any NMEA file which hasn't already been converted will be converted and appear in the folder
Desktop\navi-convert\gpx
Once this is set up and you are used to the workflow, it is an extremely efficient way of converting files.

Using with Linux

You don't need the windows package for Linux. Assuming you have GPSbabel installed ("aptitude install gpsbabel" on debian-like systems), save the following script to a text file called gpxconvert then make executable (chmod a+x gpxconvert).
#!/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
To use, simply do
./gpxconvert /path/to/gpx/files/*.TXT
The script will generate a .gpx file for any file which doesn't already exist.

FILES

Windows package:
navi-convert.zip

Optional source files
Source for GPL WinBash
Source for GPL GPSBabel

<<Back