[gdal-dev] X-Plane runway orientation
Martin Spott
Martin.Spott at mgras.net
Mon Aug 11 12:31:20 EDT 2008
Hi,
the X-Plane driver is reading a single name for a runway and computes
the opposite runway direction. Apparently a tiny mistake has crept into
the respective logic: Currently the opposite of runway 18 is being
computed as runway 00 - but there's no such thing as a runway 00,
instead we're supposed to have runway 36.
The following patch is meant to fix this issue:
--- ./gdal-svn-trunk-2008.08.10/ogr/ogrsf_frmts/xplane/ogr_xplane_apt_reader.cpp~ 2008-08-11 18:15:26.000000000 +0200
+++ ./gdal-svn-trunk-2008.08.10/ogr/ogrsf_frmts/xplane/ogr_xplane_apt_reader.cpp 2008-08-11 18:15:26.000000000 +0200
@@ -420,7 +420,7 @@
int abReil[2];
int num1 = atoi(pszRwyNum);
- int num2 = (num1 < 18) ? num1 + 18 : num1 - 18;
+ int num2 = (num1 > 18) ? num1 - 18 : num1 + 18;
if (pszRwyNum[2] == '0' || pszRwyNum[2] == 'x')
{
aosRwyNum[0].Printf("%02d", num1);
Please note that I have been looking at the runway threshold names only !!
I'm pretty convinced there are more places (in the same file) where a
similar patch should get applied, most of these look something like:
dfTrueHeading : (dfTrueHeading < 180) ? dfTrueHeading + 180 : dfTrueHeading - 180
Because I don't know I in which output table to cross-check the
respective results, I decided to leave these unchanged.
Please to me the honour of applying at least this single patch.
Thanks,
Martin.
--
Unix _IS_ user friendly - it's just selective about who its friends are !
--------------------------------------------------------------------------
More information about the gdal-dev
mailing list