Skip to content

Instantly share code, notes, and snippets.

@webratz
Last active May 31, 2021 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webratz/6bb80a166c23be7c488f21a005027a90 to your computer and use it in GitHub Desktop.
Save webratz/6bb80a166c23be7c488f21a005027a90 to your computer and use it in GitHub Desktop.
convert GPX (eg from rother) to kml(eg for maps.me=
#!/usr/bin/env bash
mkdir -p kml
for i in *.gpx
do
f=${i##*/}
target=kml/${f%.gpx}.kml
echo "$target"
# -x nuketypes,tracks
gpsbabel -i gpx -f "$i" -o kml,points=0 -F "${target}"
done
mkdir -p kmz
for i in kml/*.kml
do
f=${i##*/}
target=kmz/${f%.kml}.kmz
echo "$target"
# -x nuketypes,tracks
# gpsbabel -i gpx -f "$i" -o kml,points=0 -F "${target}"
mkdir -p tmp
cp "$i" tmp/doc.kml
zip -q -j "${target}" tmp/doc.kml
rm -rf tmp/doc.kml
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment