comparison fetch_weather.pl @ 201:92f4a489b7ef

Add data type index.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 18 Jun 2014 20:46:15 +0300
parents bfa9bbcad2e5
children 2ac661d551b3
comparison
equal deleted inserted replaced
200:bfa9bbcad2e5 201:92f4a489b7ef
381 for (my $n = 1; $n < scalar(@$oelems); $n++) 381 for (my $n = 1; $n < scalar(@$oelems); $n++)
382 { 382 {
383 my $fdata = @$oelems[$n]->{"nodes"}; 383 my $fdata = @$oelems[$n]->{"nodes"};
384 $weatherdata->{$fdata->[0]{"nodes"}[0]{"text"}} = 384 $weatherdata->{$fdata->[0]{"nodes"}[0]{"text"}} =
385 [ 385 [
386 0,
386 parse_timestamp(get_node($fdata, "text", 1), $time_base), 387 parse_timestamp(get_node($fdata, "text", 1), $time_base),
387 get_node($fdata, "text", 2), 388 get_node($fdata, "text", 2),
388 get_node($fdata, "text", 3), 389 get_node($fdata, "text", 3),
389 get_node($fdata, "text", 4), 390 get_node($fdata, "text", 4),
390 ]; 391 ];
452 foreach my $flol (@farray) 453 foreach my $flol (@farray)
453 { 454 {
454 if ($flol->{"lat"} == $flat && $flol->{"long"} == $flong) 455 if ($flol->{"lat"} == $flat && $flol->{"long"} == $flong)
455 { 456 {
456 $weatherdata->{$floc->{"gml:name"}} = 457 $weatherdata->{$floc->{"gml:name"}} =
458 [
459 1,
457 $flol->{"time"}, 460 $flol->{"time"},
458 $flol->{"temp"}, 461 $flol->{"temp"},
459 "", 462 "",
460 "", 463 "",
461 defined($flol->{"humidity"}) ? $flol->{"humidity"} : "", 464 defined($flol->{"humidity"}) ? $flol->{"humidity"} : "",