[gdal-dev] Re: X-Plane runway orientation

Even Rouault even.rouault at mines-paris.org
Mon Aug 18 15:07:24 EDT 2008


Hi Martin,

I've applied your patch in r15154.

As far as the true heading is concerned, I'm not sure if it is necessary to 
change things as it is an angle, and 0 or 360 mean pretty much the same 
thing. Furthermore, this value is probably not directly read by "humans", but 
used for computations. Which is different from the runway name, where there 
is clearly a naming convention.

Le Monday 11 August 2008 18:31:20 Martin Spott, vous avez écrit :
> 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.cp
>p~	2008-08-11 18:15:26.000000000 +0200 +++
> ./gdal-svn-trunk-2008.08.10/ogr/ogrsf_frmts/xplane/ogr_xplane_apt_reader.cp
>p	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.




More information about the gdal-dev mailing list