]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.cxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / Airports / simple.cxx
index c5ac75baff32d7dc52568c14d0d2ee6e8abfb338..a085fab57ab7804084100bb8cea4983decb7672a 100644 (file)
@@ -456,9 +456,13 @@ void FGAirport::readTowerData(SGPropertyNode* aRoot)
   SGPropertyNode* twrNode = aRoot->getChild("tower")->getChild("twr");
   double lat = twrNode->getDoubleValue("lat"), 
     lon = twrNode->getDoubleValue("lon"), 
-    elevM = twrNode->getDoubleValue("elev-m");
-    
-  _tower_location = SGGeod::fromDegM(lon, lat, elevM);
+    elevM = twrNode->getDoubleValue("elev-m");  
+// tower elevation is AGL, not AMSL. Since we don't want to depend on the
+// scenery for a precise terrain elevation, we use the field elevation
+// (this is also what the apt.dat code does)
+  double fieldElevationM = geod().getElevationM();
+  
+  _tower_location = SGGeod::fromDegM(lon, lat, fieldElevationM + elevM);
 }
 
 bool FGAirport::buildApproach(Waypt* aEnroute, STAR* aSTAR, FGRunway* aRwy, WayptVec& aRoute)