Re: [Flightgear-devel] List Etiquette was airport list

2012-04-13 Thread gapalp
Sorry. I have the settings corrected now.

gapalp
gap...@gapalp.net

>  Original Message 
> Subject: Re: [Flightgear-devel] List Etiquette was airport list
> From: Ron Jensen 
> Date: Fri, April 13, 2012 9:12 am
> To: FlightGear developers discussions
> 
> 
> 
> On Thursday 12 April 2012 16:11:14 gap...@gapalp.net wrote:
> > Wow, this works better, is simpler code, and is much
> > faster! Plus it will be easy to allow the user to pass configurations such
> > as range and airport type as mentioned, to suit GA planes or
> > heavies.    AirportInfoFilter
> > filter;    double maxRange =
> > 300.0;    FGPositioned::List results =
> > FGPositioned::findWithinRange(globals->get_aircraft_position(), range,
> > &filter);    FGPositioned::sortByRange(results,
> > globals->get_aircraft_position());    string
> > dest[results.size()];    for (unsigned int i=0; i <
> > results.size(); i++) {   
> > dest[i] = results[i]->ident();   
> > }gapalp > href="mailto:gap...@gapalp.net";>gap...@gapalp.net >iv>  
> 
> 
> Please send your mails to this list in plain text not HTML. 
> 
> Thank you,
> 
> Ron 
> 
> --
> 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
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel


--
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] airport list

2012-04-12 Thread gapalp
Wow, this works better, is simpler code, and is much faster! Plus it will be easy to allow the user to pass configurations such as range and airport type as mentioned, to suit GA planes or heavies.    AirportInfoFilter filter;    double maxRange = 300.0;    FGPositioned::List results = FGPositioned::findWithinRange(globals->get_aircraft_position(), range, &filter);    FGPositioned::sortByRange(results, globals->get_aircraft_position());    string dest[results.size()];    for (unsigned int i=0; i < results.size(); i++) {    dest[i] = results[i]->ident();    }gapalpgap...@gapalp.net


 Original Message 
Subject: Re: [Flightgear-devel] airport list
From: <gap...@gapalp.net>
Date: Thu, April 12, 2012 1:09 pm
To: "FlightGear developers discussions"
<flightgear-devel@lists.sourceforge.net>

Great! I will work with FGPositioned::findWithinRange to see what I can come up with that's hopefully more efficient.  gapalp gap...@gapalp.net       Original Message Subject: Re: [Flightgear-devel] airport listFrom: James Turner <zakal...@mac.com>Date: Thu, April 12, 2012 10:08 amTo: FlightGear developers discussions<flightgear-devel@lists.sourceforge.net>On 12 Apr 2012, at 14:54, gap...@gapalp.net wrote:> I did note the results were slow. It can take up to 5 - 10 seconds to generate the list. > > I am looking for a list of ICAOs that branch out from one's current airport within a radius. The below method returns what I want, albeit a bit slow. A listing of ICAOs would be OK, but generating a job with a destination 5000 miles away wouldn't make much sense for most user's amount of time they have to spend in a flying session without being able to save their progress. So I am thinking more of regional jobs that could be completed in 30 minutes to a few hours dependent on the aircraft. Thus the concept of using a list of all ICAOs within x radius of the airport one is grounded at to use with the generation of the random job. Of course it could all be configurable by the user too.> > I entertained using the apt.dat file or a custom xml file but wanted to try some of the built-in functions first.Aha. So what you actually want it all *sensible* airports within a certain NM cut-off. Where sensible means, likely to generate cargo - no grass/gravel strips, or, well, maybe, depending on the kind of cargo you're modelling - northern Canadian or remote Australian supply runs?You can generate what you need in a single call, possibly creating a new AirportFilter subclass to implement the size criteria. The call you need is:FGPositioned::findWithinRangePassing in your desired cutoff in *nautical miles*, and a suitable filter object. For a filter object, subclass FGAirport::AirportFilter or FGAirport::HardSurfaceFilter, and extend it to reject / pass airports you deem unsuitable for your cargo traffic. For examples of subclassing these, look at MapAirportFilter, MetarAirportFilter or AirportInfoFilter.Note that 'findWithinRange' is generally used in the simulator for ranges *less* than 1000nm, at which point the performance is 'fast enough' - if you start to increase the range to 2000nm, I don't know how it will perform - let me know!Any other questions, just ask.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 listFlightgear-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/flightgear-devel --
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel




--
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] airport list

2012-04-12 Thread gapalp
Great! I will work with FGPositioned::findWithinRange to see what I can come up with that's hopefully more efficient.

gapalp
gap...@gapalp.net
 
 

 Original Message Subject: Re: [Flightgear-devel] airport listFrom: James Turner <zakal...@mac.com>Date: Thu, April 12, 2012 10:08 amTo: FlightGear developers discussions<flightgear-devel@lists.sourceforge.net>On 12 Apr 2012, at 14:54, gap...@gapalp.net wrote:> I did note the results were slow. It can take up to 5 - 10 seconds to generate the list. > > I am looking for a list of ICAOs that branch out from one's current airport within a radius. The below method returns what I want, albeit a bit slow. A listing of ICAOs would be OK, but generating a job with a destination 5000 miles away wouldn't make much sense for most user's amount of time they have to spend in a flying session without being able to save their progress. So I am thinking more of regional jobs that could be completed in 30 minutes to a few hours dependent on the aircraft. Thus the concept of using a list of all ICAOs within x radius of the airport one is grounded at to use with the generation of the random job. Of course it could all be configurable by the user too.> > I entertained using the apt.dat file or a custom xml file but wanted to try some of the built-in functions first.Aha. So what you actually want it all *sensible* airports within a certain NM cut-off. Where sensible means, likely to generate cargo - no grass/gravel strips, or, well, maybe, depending on the kind of cargo you're modelling - northern Canadian or remote Australian supply runs?You can generate what you need in a single call, possibly creating a new AirportFilter subclass to implement the size criteria. The call you need is:FGPositioned::findWithinRangePassing in your desired cutoff in *nautical miles*, and a suitable filter object. For a filter object, subclass FGAirport::AirportFilter or FGAirport::HardSurfaceFilter, and extend it to reject / pass airports you deem unsuitable for your cargo traffic. For examples of subclassing these, look at MapAirportFilter, MetarAirportFilter or AirportInfoFilter.Note that 'findWithinRange' is generally used in the simulator for ranges *less* than 1000nm, at which point the performance is 'fast enough' - if you start to increase the range to 2000nm, I don't know how it will perform - let me know!Any other questions, just ask.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 listFlightgear-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/flightgear-devel

--
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] airport list

2012-04-12 Thread gapalp
I did note the results were slow. It can take up to 5 - 10 seconds to generate the list. 
 
I am looking for a list of ICAOs that branch out from one's current airport within a radius. The below method returns what I want, albeit a bit slow. A listing of ICAOs would be OK, but generating a job with a destination 5000 miles away wouldn't make much sense for most user's amount of time they have to spend in a flying session without being able to save their progress. So I am thinking more of regional jobs that could be completed in 30 minutes to a few hours dependent on the aircraft. Thus the concept of using a list of all ICAOs within x radius of the airport one is grounded at to use with the generation of the random job. Of course it could all be configurable by the user too.
 
I entertained using the apt.dat file or a custom xml file but wanted to try some of the built-in functions first.

gapalp
gap...@gapalp.net
 
 

 Original Message Subject: Re: [Flightgear-devel] airport listFrom: James Turner <zakal...@mac.com>Date: Thu, April 12, 2012 3:59 amTo: FlightGear developers discussions<flightgear-devel@lists.sourceforge.net>On 11 Apr 2012, at 20:48, gap...@gapalp.net 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 listFlightgear-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/flightgear-devel

--
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] airport list

2012-04-11 Thread gapalp
I figured out how to use FGAirport::findClosest to accomplish what I needed:static SGConstPropertyNode_ptr latn = fgGetNode("/position/latitude-deg", true);static SGConstPropertyNode_ptr lonn = fgGetNode("/position/longitude-deg", true);SGGeod pos;FGAirport* apt = NULL;AirportInfoFilter filter;double maxRange = 1.0;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:for (float i=.1; i < 5; i = i + .1)    {    pos = SGGeod::fromDeg(lonn->getDoubleValue(), latn->getDoubleValue() + i);    apt = FGAirport::findClosest(pos, maxRange, &filter);    string id = apt->ident();    dest[x] = id;    x = x + 1;    }In the above dest[] will contain 50 ICAOs. Some will be duplicates since a .1 increment in latitude may result in the same airport being the nearest. But that can be tweaked to one's need.gapalpgap...@gapalp.net


 Original Message 
Subject: [Flightgear-devel] airport list
From: 
Date: Mon, April 09, 2012 6:34 pm
To: "FlightGear Development" 

I just started playing around in FlightGear development and wanted to intro myself. You all have a great piece of software here and I am enjoying it. I come from years of flight simming in other programs and doing some small commercial work in them. My day job involves corporate app development. My hobbies are astronomy, flight simming, and coding.Anyway, I am playing around with a cargo manager for FG. I have run into needing to pull an airport list to use in a random cargo job generator. Airinfo() and navinfo() don't appear to do it for me. Any way to get the list using an available C++ function? Just a list of ICAOs would be a start. Or will I need to read/parse through the apt.dat file?Thanks and I look forward to some coding fun :)gapalpgap...@gapalp.net --
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel




--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] airport list

2012-04-09 Thread gapalp
I just started playing around in FlightGear development and wanted to intro myself. You all have a great piece of software here and I am enjoying it. I come from years of flight simming in other programs and doing some small commercial work in them. My day job involves corporate app development. My hobbies are astronomy, flight simming, and coding.Anyway, I am playing around with a cargo manager for FG. I have run into needing to pull an airport list to use in a random cargo job generator. Airinfo() and navinfo() don't appear to do it for me. Any way to get the list using an available C++ function? Just a list of ICAOs would be a start. Or will I need to read/parse through the apt.dat file?Thanks and I look forward to some coding fun :)gapalpgap...@gapalp.net

--
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
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel