[hamradio-commits] [dump1090-mutability] 40/172: Add support for controlling the accuracy of the receiver location written in the JSON metadata used by the webmap.

Matteo F. Vescovi mfv at moszumanska.debian.org
Sun Jan 28 13:45:44 UTC 2018


This is an automated email from the git hooks/post-receive script.

mfv pushed a commit to branch master
in repository dump1090-mutability.

commit ffbbd16928490ee410ffdf140f13a1f762e93993
Author: Oliver Jowett <oliver at mutability.co.uk>
Date:   Sat Dec 27 20:52:56 2014 +0000

    Add support for controlling the accuracy of the receiver location
    written in the JSON metadata used by the webmap.
---
 debian/changelog                     |  2 ++
 debian/config-template               |  3 +++
 debian/dump1090-mutability.config    |  2 ++
 debian/dump1090-mutability.init      |  6 ++++++
 debian/dump1090-mutability.postinst  |  1 +
 debian/dump1090-mutability.templates | 21 +++++++++++++++++++++
 6 files changed, 35 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8886b6b..00440f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ dump1090-mutability (1.08.2302.14+1mu-4) UNRELEASED; urgency=medium
   * Remove half-implemented --no-decode option.
   * Remove Windows support files that aren't needed for the Debian package.
   * Remove some legacy support scripts not needed by the Debian package.
+  * Add support for controlling the accuracy of the receiver location
+    written in the JSON metadata used by the webmap.
 
  -- Oliver Jowett <oliver at mutability.co.uk>  Sat, 27 Dec 2014 20:08:44 +0000
 
diff --git a/debian/config-template b/debian/config-template
index 4c723fc..615c6fa 100644
--- a/debian/config-template
+++ b/debian/config-template
@@ -112,5 +112,8 @@ JSON_DIR=
 # Interval between writing json state (in seconds). 0 disables.
 JSON_INTERVAL=
 
+# Accuracy of receiver location to write to json state, one of "exact" / "approximate" / "none"
+JSON_LOCATION_ACCURACY=
+
 # Additional options that are passed to the Daemon.
 EXTRA_ARGS=
diff --git a/debian/dump1090-mutability.config b/debian/dump1090-mutability.config
index 48df016..68bc998 100644
--- a/debian/dump1090-mutability.config
+++ b/debian/dump1090-mutability.config
@@ -47,6 +47,7 @@ if [ -e $CONFIGFILE ]; then
   db_set $NAME/stats-interval "$STATS_INTERVAL"
   db_set $NAME/json-dir "$JSON_DIR"
   db_set $NAME/json-interval "$JSON_INTERVAL"
+  db_set $NAME/json-location-accuracy "$JSON_LOCATION_ACCURACY"
   db_set $NAME/extra-args "$EXTRA_ARGS"
 fi
 
@@ -202,6 +203,7 @@ db_go || true; db_get $NAME/auto-start; if [ "$RET" = "true" ]; then
  db_go || true; db_get $NAME/json-interval; if [ -n "$RET" ] && [ "$RET" -gt 0 ]; then
   # only if json-interval was given and non-zero
   db_input low $NAME/json-dir || true
+  db_input low $NAME/json-location-accuracy || true
  fi
  
  db_input low $NAME/extra-args || true
diff --git a/debian/dump1090-mutability.init b/debian/dump1090-mutability.init
index 1c9d8d3..ed900eb 100644
--- a/debian/dump1090-mutability.init
+++ b/debian/dump1090-mutability.init
@@ -83,6 +83,12 @@ if [ -n "$NET_BIND_ADDRESS" ]; then ARGS="$ARGS --net-bind-address $NET_BIND_ADD
 if [ -n "$STATS_INTERVAL" ]; then ARGS="$ARGS --stats-every $STATS_INTERVAL"; fi
 if [ -n "$JSON_DIR" ]; then ARGS="$ARGS --write-json $JSON_DIR"; fi
 if [ -n "$JSON_INTERVAL" ]; then ARGS="$ARGS --write-json-every $JSON_INTERVAL"; fi
+case "x$JSON_LOCATION_ACCURACY" in
+  xexact) ARGS="$ARGS --json-location-accuracy 2" ;;
+  xapproximate) ARGS="$ARGS --json-location-accuracy 1" ;;
+  *) ARGS="$ARGS --json-location-accuracy 0" ;;
+esac
+
 if [ -n "$EXTRA_ARGS" ]; then ARGS="$ARGS $EXTRA_ARGS"; fi
 
 # Load the VERBOSE setting and other rcS variables
diff --git a/debian/dump1090-mutability.postinst b/debian/dump1090-mutability.postinst
index 2402a19..04fac1e 100644
--- a/debian/dump1090-mutability.postinst
+++ b/debian/dump1090-mutability.postinst
@@ -84,6 +84,7 @@ case "$1" in
         subvar stats-interval STATS_INTERVAL
         subvar json-dir JSON_DIR
         subvar json-interval JSON_INTERVAL
+        subvar json-location-accuracy JSON_LOCATION_ACCURACY
         subvar extra-args EXTRA_ARGS
 
         cp -a -f $CONFIGFILE $CONFIGFILE.tmp
diff --git a/debian/dump1090-mutability.templates b/debian/dump1090-mutability.templates
index 2e14b57..68b6a70 100644
--- a/debian/dump1090-mutability.templates
+++ b/debian/dump1090-mutability.templates
@@ -234,6 +234,27 @@ Description: Interval between writing JSON aircraft state, in seconds:
 Type: string
 Default: 1
 
+Template: dump1090-mutability/json-location-accuracy
+Description: Receiver location accuracy to show in the web interface:
+ dump1090 can provide the configured receiver location to the web map,
+ so that the map can show distances from the receiver.
+ .
+ For privacy reasons, if you are making the map publicly available you
+ may not want to show the exact location of the receiver. There are three
+ options available to control what is shown:
+ .
+ approximate: dump1090 will provide the receiver location rounded to the
+   nearest 0.01 degree of latitude and longitude. This gives a location
+   that is accurate to within about 0.5 - 1km.
+ .
+ exact: dump1090 will provide the exact receiver location.
+ .
+ none: dump1090 will not provide the receiver location at all; distance
+   display will be disabled.
+Type: select
+Choices: approximate, exact, none
+Default: approximate
+
 Template: dump1090-mutability/extra-args
 Description: Extra arguments to pass to dump1090:
  Here you can add any extra arguments you want to pass to dump1090.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090-mutability.git



More information about the pkg-hamradio-commits mailing list