diff fetch_weather.pl @ 414:d623652df6b5

fetch_weather / weather: Add weather measurement station location data (GPS WGS-84 lat/long/height) to weather cache. Not used in weather.tcl yet, tho.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 07 Jan 2017 22:37:56 +0200
parents b63525aed190
children c88f7449b526
line wrap: on
line diff
--- a/fetch_weather.pl	Sat Jan 07 22:36:34 2017 +0200
+++ b/fetch_weather.pl	Sat Jan 07 22:37:56 2017 +0200
@@ -413,6 +413,11 @@
             $weatherdata->{$meta_data->{$wid}{"properties"}{"names"}{"fi"}} =
             [
               1,
+
+              $meta_data->{$wid}{"geometry"}{"coordinates"}[1],
+              $meta_data->{$wid}{"geometry"}{"coordinates"}[0],
+              $meta_data->{$wid}{"geometry"}{"coordinates"}[2],
+
               str2time(plonk_data($wdata->{"measurementtime"}{"utc"})),
               plonk_data($wdata->{"airtemperature1"}),
 
@@ -531,6 +536,10 @@
               [
                 1,
 
+                $frec->{"lat"},
+                $frec->{"long"},
+                0,
+
                 plonk_data($frec->{"time"}),
                 plonk_data($frec->{"temperature"}),
 
@@ -575,7 +584,7 @@
 
     foreach my $key (keys %$weatherdata)
     {
-      if ($wqtime - $weatherdata->{$key}[1] > (60 * $purge))
+      if ($wqtime - $weatherdata->{$key}[4] > (60 * $purge))
       {
         delete $$weatherdata{$key};
       }