]> git.mxchange.org Git - flightgear.git/blobdiff - scripts/perl/dafif/dafift2ils.pl
Many ILS approaches do not have a listed GS elevation in the FAA or in the
[flightgear.git] / scripts / perl / dafif / dafift2ils.pl
index 1e0b559892ea240e2de45f2859964e40f7bf9010..19cb9195a70ead0c7e3269a2d74e5f3851053d7d 100755 (executable)
@@ -260,6 +260,7 @@ sub load_faa() {
         $id = &strip_ws( $id );
         $rwy = &strip_ws( $rwy );
         $rwy =~ s/\/$//;
+        $rwy =~ s/\/$//;
         $loc_id =~ s/^I-//;
         my( $loc_hdg ) = $faa_bearing + make_dmagvar($faa_magvar);
         my( $loc_lat ) = make_dcoord($faa_loc_lats) / 3600.0;
@@ -327,17 +328,18 @@ sub load_fgfs() {
             my( $code ) = $icao;
             $code =~ s/^K//;
             if ( $ILS{$icao . $rwy} ne "" ) {
+                print "FGFS: Skipping $icao - $rwy - already exists\n";
                 # skip approaches already in FAA or DAFIFT data
-            } elsif ( $AIRPORTS{$icao} != 1 && $AIRPORTS{$code} != 1 ) {
-                # skip approaches if the FAA or DAFIFT data has any other
-                # approach already for this airport.  (Avoids carrying over
-                # extraneous data if an approach was deactivated or runway
-                # numbers were changed.)
             } elsif ( length( $icao ) < 4 || $icao =~ m/^K/ ) {
+                print "FGFS: Skipping $icao - $rwy - USA\n";
                 # skip USA approaches not found in FAA or DAFIFT data
             } else {
                 print "FGFS adding: $icao $rwy\n";
-                $ILS{$icao . $rwy} = $_;
+                &safe_add_record( $icao, $rwy, $type_name, $loc_freq, $loc_id,
+                                  $loc_hdg, $loc_lat, $loc_lon, $gs_elev,
+                                  $gs_angle, $gs_lat, $gs_lon, $dme_lat,
+                                  $dme_lon, $om_lat, $om_lon, $mm_lat,
+                                  $mm_lon, $im_lat, $im_lon );
             }
         } else {
             print "FGFS discarding: $_\n";