3 #=======================================================================
5 # File ID: 46c65064-61d7-11e5-8232-fefdb24f8e10
7 # Plot GPS tracks around a specific waypoint.
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
16 if test "$1" = "--version"; then
17 echo $progname $VERSION
21 if test "$1" = "-h" -o "$1" = "--help"; then
24 Plot GPS tracks around a specific waypoint.
28 $progname waypoint_name [radius_in_metres]
36 List all available waypoints.
38 Print version information.
45 if test -z "$name"; then
46 echo $progname: No waypoint name specified
>&2
50 if test "$name" = "-l" -o "$name" = "--list"; then
51 psql gps
-c "COPY (SELECT name FROM wp) TO STDOUT;"
56 test -n "$2" && radius
="$2"
57 echo $progname: radius
= $radius metres
59 tmpfile
="/tmp/.posmap.$(date +%s).$$.tmp"
60 cat <<SQL_END | psql gps >"$tmpfile"
67 ) < 1.0*$radius/100000