From fb7c24cf1dc463219b4c2392839ebecb3e588ab6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20A=2E=20Holm?= Date: Wed, 23 Sep 2015 12:24:17 +0200 Subject: [PATCH] posmap: New script for plotting GPS tracks around a specific waypoint 50cb1cba-61dd-11e5-adb3-fefdb24f8e10 --- posmap | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 posmap diff --git a/posmap b/posmap new file mode 100755 index 0000000..077f014 --- /dev/null +++ b/posmap @@ -0,0 +1,62 @@ +#!/bin/bash + +#======================================================================= +# posmap +# File ID: 46c65064-61d7-11e5-8232-fefdb24f8e10 +# +# Plot GPS tracks around a specific waypoint. +# +# Author: Øyvind A. Holm +# License: GNU General Public License version 2 or later. +#======================================================================= + +progname=posmap +VERSION=0.1.0 + +if test "$1" = "--version"; then + echo $progname $VERSION + exit 0 +fi + +if test "$1" = "-h" -o "$1" = "--help"; then + cat <&2 + exit 1 +fi + +radius=100 +test -n "$2" && radius="$2" +echo $progname: radius = $radius metres + +tmpfile="/tmp/.posmap.$(date +%s).$$.tmp" +cat <"$tmpfile" +COPY ( + SELECT gpst FROM gpst + WHERE (coor <-> ( + SELECT coor FROM wayp + WHERE name = '$1' + LIMIT 1 + ) < 1.0*$radius/100000 + ) +) TO STDOUT; +SQL_END +vg -2 -wd "$tmpfile" +rm "$tmpfile" -- 2.11.4.GIT