Diff for /cup-aerodromes.perl between versions 1.2 and 1.3

version 1.2, 2013/12/21 00:40:30 version 1.3, 2013/12/22 01:18:25
Line 9  my $aerodromes; Line 9  my $aerodromes;
 my $xml = "aerodromes.gpx";  my $xml = "aerodromes.gpx";
 if ( defined $xml ){  if ( defined $xml ){
  my $xs = XML::Simple->new();   my $xs = XML::Simple->new();
  $aerodromes = $xs->XMLin($xml, KeyAttr => { wpt => "name", 'runway' => "designation" }, ForceArray => ['runway','frequency']);   $aerodromes = $xs->XMLin($xml, KeyAttr => { wpt => "name" }, ForceArray => ['runway','frequency']);
 }  }
   
 #print Dumper($aerodromes);  #print Dumper($aerodromes);
Line 33  foreach my $ad ( keys %{$aerodromes->{'w Line 33  foreach my $ad ( keys %{$aerodromes->{'w
    print TXT $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'frequencies'}->{'frequency'}->[$f]->{'desc'};     print TXT $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'frequencies'}->{'frequency'}->[$f]->{'desc'};
    print TXT "\n";     print TXT "\n";
   }    }
   # Some aerodromes have two runways with the same designation, e.g. Alexandra. Must find a fix ...    foreach my $rw ( 0 .. $#{ $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'runways'}->{'runway'} }){
   foreach my $rw ( $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'runways'}->{'runway'} ){     print TXT $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'runways'}->{'runway'}->[$rw]->{'designation'};
    foreach my $runway ( keys %{$rw} ){     print TXT " ";
     print TXT qq[$runway $rw->{$runway}->{'length'} x $rw->{$runway}->{'width'} $rw->{$runway}->{'surface'}\n];     print TXT $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'runways'}->{'runway'}->[$rw]->{'length'};
    }     print TXT " x ";
      print TXT $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'runways'}->{'runway'}->[$rw]->{'width'};
      print TXT " ";
      print TXT $aerodromes->{'wpt'}->{$ad}->{'extensions'}->{'aerodrome'}->{'runways'}->{'runway'}->[$rw]->{'surface'};
      print TXT "\n";
   }    }
  }   }
 }  }

Removed from v.1.2  
changed lines
  Added in v.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>