Last active
May 31, 2021 12:01
-
-
Save webratz/6bb80a166c23be7c488f21a005027a90 to your computer and use it in GitHub Desktop.
convert GPX (eg from rother) to kml(eg for maps.me=
This file contains 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 | |
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