On 11 Apr 2012, at 20:48, [email protected] wrote:

> pos = SGGeod::fromDeg(lonn->getDoubleValue(), latn->getDoubleValue());
> apt = FGAirport::findClosest(pos, maxRange, &filter);
> string id = apt->ident();
> 
> The above results in id being the single nearest ICAO. Throw this in a loop 
> and iterate the pos lonn/lat the amount of the loop iterator, put the results 
> in an array, then choose a random ICAO from the array using rand(). Then you 
> have a list of ICAOs N, S, E, and W from your current location. The longer 
> the loop or the greater the iterator, the further away the ICAOs go. For 
> example:

Uh, the findClosest (and related FGPositioned functions) use the spatial index, 
which is probably not what you want - since they're a bit slower.

What exactly *do* you want? The current query functions support querying by 
position or by ident (possibly a partial ident).

If you're looking for a flat list of all the airport IDs, that may not actually 
be exposed right now in C++, but would be trivial to add.

James


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to