Monday 27 February 2017

gpsbabel - How to extract the speed from a .gpx file?


Sometimes the .gpx file that you obtain from your GPS-Device does not deliver the speed. The file looks like this:


[...]

518.38


[...]

The speed is missing. How is it possible to obtain the speed?




Answer



Download GPSBabel - for Ubuntu just use:


sudo apt-get install gpsbabel 

With this command you will get a .gpx file of all track points with the speed (meter/second):


gpsbabel -t -i gpx -f input.gpx -x track,speed -o gpx -F output.gpx

EDIT: please see comment by drnextgis - the command requres the addition of ',gpxver=1.0' and should therefore be as below:


 gpsbabel -t -i gpx -f input.gpx -x track,speed -o gpx,gpxver=1.0 -F output.gpx


The .gpx will look like this then:


[...]

624.630000

2.338139

[...]

It is also possible to obtain other output formats like .csv:



gpsbabel -t -i gpx -f input.gpx -x track,speed -o unicsv -F output.csv

The result will look like this then:


No,Latitude,Longitude,Altitude,Speed,Date,Time
1,59.414697,3.693597,521.3,0.00,2016/07/17,10:30:14
2,59.414704,3.693641,521.3,3.28,2016/07/17,10:30:15
3,59.414789,3.694040,524.6,2.34,2016/07/17,10:30:28
[...]

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...