From e4e7d8bffd54e94af567c16df82b408483a21199 Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Thu, 18 Oct 2012 13:27:09 +0200 Subject: [PATCH] Convert remaining runway functions to SGGeod --- src/Airports/GenAirports850/airport.cxx | 4 ++-- src/Airports/GenAirports850/runway.cxx | 4 ++-- src/Airports/GenAirports850/runway.hxx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Airports/GenAirports850/airport.cxx b/src/Airports/GenAirports850/airport.cxx index b8e5a44b..de695d7e 100644 --- a/src/Airports/GenAirports850/airport.cxx +++ b/src/Airports/GenAirports850/airport.cxx @@ -560,8 +560,8 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src ) int num_samples = 0; for (unsigned int i=0; iGetMidpoint().x(); - apt_lat += runways[i]->GetMidpoint().y(); + apt_lon += runways[i]->GetMidpoint().getLongitudeDeg(); + apt_lat += runways[i]->GetMidpoint().getLatitudeDeg(); num_samples++; } for (unsigned int i=0; i #include #include -#include +#include #include #include @@ -46,7 +46,7 @@ Runway::Runway(char* definition) ); // calculate runway heading and length (used a lot) - geo_inverse_wgs_84( rwy.lat[0], rwy.lon[0], rwy.lat[1], rwy.lon[1], &rwy.heading, &az2, &rwy.length ); + SGGeodesy::inverse( GetStart(), GetEnd(), rwy.heading, az2, rwy.length ); SG_LOG(SG_GENERAL, SG_DEBUG, "Read runway: (" << rwy.lon[0] << "," << rwy.lat[0] << ") to (" << rwy.lon[1] << "," << rwy.lat[1] << ") heading: " << rwy.heading << " length: " << rwy.length << " width: " << rwy.width ); diff --git a/src/Airports/GenAirports850/runway.hxx b/src/Airports/GenAirports850/runway.hxx index daff7441..5f1ccc71 100644 --- a/src/Airports/GenAirports850/runway.hxx +++ b/src/Airports/GenAirports850/runway.hxx @@ -29,9 +29,9 @@ public: return SGGeod::fromDeg(rwy.lon[1], rwy.lat[1]); } - Point3D GetMidpoint(void) + SGGeod GetMidpoint() { - return ( Point3D( (rwy.lon[0]+rwy.lon[1])/2.0f, (rwy.lat[0]+rwy.lat[1])/2.0f, 0.0f) ); + return SGGeod::fromDeg( (rwy.lon[0]+rwy.lon[1])/2.0f, (rwy.lat[0]+rwy.lat[1])/2.0f); } bool GetsShoulder()