James,

while I'm pretty much in favour of spatial indices, note that a lot of work in 
that direction has been done already. As far as I know, Mathias Fröhlich has 
written a general templated spatial index for simgear. I've the code with me, 
but haven't found time to look at it yet (Sorry Mathias, PhD becomes more and 
more demanding).

Using that, it is not necessary to create a new base class (and new 
intermodule dependencies, where would FGPositioned be placed?). It suffices 
to implement the required interface (i.e. a few methods) in a class to make 
it usable with that template based index. The static methods can be placed in 
the index too. The signature will be only slightly bigger with one additional 
argument (the "FGPositioned"s position!!!)

Note that it is not possible with your interface to find the 
nearest "FGPositioned" to an arbitrary geodetic position yet. This is 
somewhat critical (e.g. finding things based on the user aircraft).

Additional methods I'd like to see is an extension of the nearest neighbor 
query to N-nearest neighbors. Examples might be finding the 3(or 5) nearest 
metar stations for weather interpolation, 5 nearest fixes to an airport for 
rough route planning...

Thomas




-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to