From f77da293988bd5c866b574abbc2f0abab13492b4 Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Fri, 21 Oct 2011 09:10:18 +0200 Subject: [PATCH] forgot to add length extend calculation to the new gen_wgs84_area function. Also fixed the runway area functions accordingly. --- src/Airports/GenAirports850/apt_math.cxx | 4 ++-- src/Airports/GenAirports850/runway.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Airports/GenAirports850/apt_math.cxx b/src/Airports/GenAirports850/apt_math.cxx index 3d1610c1..ec696f84 100644 --- a/src/Airports/GenAirports850/apt_math.cxx +++ b/src/Airports/GenAirports850/apt_math.cxx @@ -118,7 +118,7 @@ TGPolygon gen_wgs84_area( Point3D end1, Point3D end2, Point3D ref = end2; double lon = 0, lat = 0, r = 0; geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), heading_deg, - -displ2, &lat, &lon, &r ); + length_m / 2.0 - displ2, &lat, &lon, &r ); ref = Point3D( lon, lat, 0.0 ); // move to the l,-w corner (then we add points in a clockwise direction) @@ -146,7 +146,7 @@ TGPolygon gen_wgs84_area( Point3D end1, Point3D end2, // move to the end1 center to the displ. threshold ref = end1; geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), heading_deg, - displ1, &lat, &lon, &r ); + displ1 - length_m / 2.0, &lat, &lon, &r ); ref = Point3D( lon, lat, 0.0 ); // move to the -l,w corner (then we add points in a clockwise direction) diff --git a/src/Airports/GenAirports850/runway.hxx b/src/Airports/GenAirports850/runway.hxx index 77688c59..484a91bd 100644 --- a/src/Airports/GenAirports850/runway.hxx +++ b/src/Airports/GenAirports850/runway.hxx @@ -85,14 +85,14 @@ private: // generate an area for a runway and include midpoints TGPolygon gen_runway_w_mid( double alt_m, double length_extend_m, double width_extend_m ) { - return ( gen_wgs84_area( Point3D(GetStart()), Point3D(GetEnd()), rwy.length + 2.0*length_extend_m, 0.0, 0.0, rwy.width + 2.0 * width_extend_m, rwy.heading, alt_m, true) ); + return ( gen_wgs84_area( Point3D(GetStart()), Point3D(GetEnd()), 2.0*length_extend_m, 0.0, 0.0, rwy.width + 2.0 * width_extend_m, rwy.heading, alt_m, true) ); } // generate an area for a runway with expansion specified in meters // (return result points in degrees) TGPolygon gen_runway_area_w_extend( double alt_m, double length_extend, double displ1, double displ2, double width_extend ) { - return ( gen_wgs84_area( Point3D(GetStart()), Point3D(GetEnd()), rwy.length + 2.0*length_extend, displ1, displ2, rwy.width + 2.0*width_extend, rwy.heading, alt_m, false) ); + return ( gen_wgs84_area( Point3D(GetStart()), Point3D(GetEnd()), 2.0*length_extend, displ1, displ2, rwy.width + 2.0*width_extend, rwy.heading, alt_m, false) ); } void gen_rw_designation( const std::string& material,