GPSBabel Batch File Filter: Remove Unreliable Points (HDOP VDOP NSAT)
GPSBabel does a great job converting the waypoints, tracks, and routes of popular GPS receivers and mapping programs. Unfortunately, the Windows interface (graphical front-end) of the command-line-driven application doesn't allow for the user to adjust some of the more advanced filtering capabilities.
The (Windows XP/Vista/7) solution to easily discarding these errant data points is to create a little program. It takes just a minute or two.
The following code was sourced and altered from these tutorials: GPSBabel Drag and Drop for Windows, Remove unreliable points with high hdop or vdop (discard)
- Simply open notepad and save the following text as !cleanGPX.bat
@ECHO OFF ECHO. ECHO +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ ECHO Removes unreliable GPS tracking data from GPX log file(s) ECHO Note: This will OVERWRITE the file(s) ECHO +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ ECHO. ECHO Press Ctrl-Break to stop now or PAUSE ECHO. ECHO Working... FOR %%X IN (%*) DO ( "c:\Program Files\GPSBabel\gpsbabel.exe" -i gpx -f %%X -x discard,hdop=2,vdop=2.2,sat=3 -o gpx -F %%X ECHO %%X ECHO. ) ECHO ALL DONE! PAUSE
- Place the file anywhere you'd like (such as on the Desktop or in a folder with your GPX files). The exclamation mark in the name will keep the file at the top of the directory if sorted normally.
- Select one or more GPX files and drag them into the !cleanGPX.bat icon. The number of files doesn't matter, and running the batch file without any files won't hurt anything.
The above code will remove GPS data points with the following attributes:
- Horizontal Dilution of Precision (HDOP) above 2
- Vertical Dilution of Precision (VDOP) above 2.2
- Fewer than 3 satellites locked
Note: Feel free to adjust the thresholds to your own taste. Some sources says a HDOP over 4 or 6 is more optimal, while others say 2 or even 10 is best. You may need to enable your log to track some of this information. Review your data and adjust your limits accordingly.