Last active
March 8, 2021 20:15
-
-
Save josuecau/fb0b049ca4a58fda409286a353e805d9 to your computer and use it in GitHub Desktop.
Convert GPX routes (rte) into tracks (trk) using gpsbabel (https://www.gpsbabel.org)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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