Archived

This topic is now archived and is closed to further replies.

ahuimanu

What Country is the Plane in?

Recommended Posts

I currently use a rather awkward system to determine roughly what part of the world the plane is located in.However, I'd like to adopt a cleaner and precise method to determine which country the aircraft is.So I'm looking at this GPS variable to get the job done: FacilityRegionTrouble is, it doesn't seem to return anything in my C gauge.Anyone ever get the same thing to work?This is it for the code:PCSTRINGZ country;execute_calculator_code("(C:fs9gps:FacilityRegion, string)", NULL, NULL, &country);Cheers,Bryan

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The same request made in XML returns NULL as well.First, you have to tell the fs9gps.dll what your current ICAO code is, then it will return the FacilityRegion information.However, the FacilityRegion won't be much help, since it's usually a single letter or two, not the name of the country... Even then, the return is fairly meaningless. For example, whilst sitting at the ramp in Sion, Switzerland, the GPS returns a "Region Code" of "LS..."However, the ISO Region Code* of "LS" is the country of Lesotho, a considerable few nautical miles from Switzerland! :)* http://www.cue-dih.co.uk/aerospace/aeropdf...untry_codes.pdf

Share this post


Link to post
Share on other sites

Bryan,I spent a few delightful -albeit ultimately fruitless- hours this afternoon trying various approaches using a simple XML gauge (because it's a darn sight quicker than using a C gauge!)...Using the list of GPS Variables available (not all of which actually work, BTW) that Susan Ashlock provided a couple of years ago on her blog and to which I promptly "borrowed" for a Wiki entry:http://forums.flightsim.com/fswiki/index.p...9_GPS_VariablesI checked out trying to obtain a "Country" return... nada, zip, zilch. :(In any event, as I said previously you first have to tell the fs9gps.dll where you currently are before it will return any information. Here is the XML gauge script:C:fs9gpsC:fs9gps (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 1 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance, NMiles) 0 (>@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentIcao) (>@c:FacilityIcao) %( (@c:NearestAirportItemsNumber, Number) 1 >= )%{if}%((@c:FacilityName) uc)%!s!%{else}Loading%{end}

Share this post


Link to post
Share on other sites

Thank you Father Bill!Too bad about the country codes, but c'est la vie I guess.Ciao,Bryan

Share this post


Link to post
Share on other sites

The little cracks and fissures in the SDK are always interesting as they are unearthed.

Share this post


Link to post
Share on other sites