This is a simple script which reverses the direction of a gps track stored in a gpx file:

<pre lang="bash">#!/bin/bash
gpsbabel -t -i gpx -f $1 -x transform,rte=trk,del -o gpx -F 1.$1
gpsbabel -t -i gpx -f 1.$1 -x reverse -o gpx -F 2.$1
gpsbabel -t -i gpx -f 2.$1 -x transform,trk=rte,del -o gpx -F rev.$1
rm 1.$1 2.$1

will generate a rev.file.gpx from file.gpx

Comments:

Gon -

However the timestamps will be now in a wrong time order… It would be cool to be able to maintain the time gaps between trackpoints together with the start/end times. Cheers!