diff options
author | Karl Berry <karl@freefriends.org> | 2014-08-12 21:41:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-08-12 21:41:30 +0000 |
commit | ca4c4b70f17ec42f8267024b244a185769efd9d1 (patch) | |
tree | aef1aa9175fb3421c081a891378b6fab369e1648 /Master/texmf-dist/scripts | |
parent | 666535e53fe160d45e038feb00c7d348809d9a6e (diff) |
getmap (12aug14)
git-svn-id: svn://tug.org/texlive/trunk@34917 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rw-r--r-- | Master/texmf-dist/scripts/getmap/gpx2gps | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/getmap/gpx2gps b/Master/texmf-dist/scripts/getmap/gpx2gps new file mode 100644 index 00000000000..1dc51b23614 --- /dev/null +++ b/Master/texmf-dist/scripts/getmap/gpx2gps @@ -0,0 +1,40 @@ +#!/bin/bash +# +# gpx2gps file.gpx +# +# parses file.gpx and outputs a list of +# geographical coordinates latitude,longitude +# +# License: LPPL +# +filename="$1" +version="v1.0 (12/08/2014)" +# +usage() +{ + echo -e "Usage: `basename $0` file.gpx" + echo -e "Version: $version" + exit 1 +} +# +if [ -z "$filename" ] +then + usage +fi +if [ "$filename" = "-h" ] +then + usage +fi +if [ ! -e "$filename" ] +then + echo -e "File $filename does not exist!" + exit 2 +fi +# +for line in `grep -e "<trkpt" $filename | tr ' ' '+'` +do + latitude=`echo "$line" | sed -e 's#.*lat="\(.*\)".*#\1#' -e 's#".*$##'` + longitude=`echo "$line" | sed -e 's#.*lon="\(.*\)".*#\1#' -e 's#".*$##'` + echo "$latitude,$longitude" +done +exit 0 |