Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert GPX routes (rte) into tracks (trk) using gpsbabel (https://www.gpsbabel.org)
#!/usr/bin/env bash
#
# Convert GPX routes (rte) into tracks (trk) using gpsbabel.
# (https://www.gpsbabel.org/)
set -e
if ! type gpsbabel >/dev/null 2>&1; then
echo 'gpsbabel not found'
exit 1
fi
if [ $# -ne 2 ]
then
echo "Usage: $(basename "$0") <input.gpx> <output.gpx>"
exit 1
fi
gpsbabel -i gpx -f "$1" -x transform,trk=rte,del -o gpx -F "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment