changeset 352:19b363586b40

fetch_weather: Fix debug prints.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 11 Dec 2015 22:16:18 +0200
parents 0f55bbb7fea3
children a52a983c0c14
files fetch_weather.pl
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/fetch_weather.pl	Fri Nov 27 13:46:01 2015 +0200
+++ b/fetch_weather.pl	Fri Dec 11 22:16:18 2015 +0200
@@ -419,13 +419,13 @@
 
       # This is horrible :S
       my $fcrap = $fdata->{"om:featureOfInterest"}{"sams:SF_SpatialSamplingFeature"}{"sams:shape"}{"gml:MultiPoint"}{"gml:pointMember"};
+      my $nrecords = 0;
       foreach my $xnode (@{$fcrap})
       {
         my $floc = $xnode->{"gml:Point"};
         if ($floc->{"gml:pos"} =~ /^\s*([\+\-]?\d+\.\d*)\s+([\+\-]?\d+\.\d*)\s*$/)
         {
           my ($flat, $flong) = ($1, $2);
-          my $nrecords = 0;
 
           # Should use a hash -
           foreach my $flol (@farray)
@@ -445,9 +445,9 @@
               ];
             }
           }
-          print STDERR $nrecords." records from FMI.\n" if (opt_get_int("debug") > 0);
         }
       }
+      print STDERR $nrecords." records from FMI.\n" if (opt_get_int("debug") > 0);
     } else {
       # defined
       print STDERR "Invalid XML received:\n";