On 21 Oct 2008, at 03:56, Alasdair Campbell wrote:

> I have now established why this problem appeared so weird. In
> Instrumentation/mk_viii.cxx at line 4534 you've got latitude and
> longitude transposed in
> const FGAirport *airport = globals->get_airports()->search(
>      mk_data(gps_latitude).get(), mk_data(gps_longitude).get(),
> 0.5, filter);
> Correcting this error will will cause the Citations to crash at line
> 4545 at ALL airports which is kind of saner.
>
> As you suggested, the problem seems to lie in the longitude(),
> latitude() etc defined in positioned.hxx I have beavered away in the
> midnight oil to fix, but am too hampered by poor c++ skills.

Thanks for the analysis, I'll dig into this in a moment (cup of tea  
required first).

The order of latitude and longitude has bitten me in a few places  
already - I have some tests for the internals (verifying what nearest  
airport returns, etc) but it's harder to write tests for the callers  
without complicating their code. My preferring solution is to  
gradually change all these APIs to take a SGGeod anyway, and that  
particular problem goes away completely.

But, there's some more important issue here besides a swapped lat/lon,  
as you note.

Cheers,
James


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to