Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What Country is the Plane in?

Featured Replies

  • Commercial Member

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

  • Moderator

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

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Moderator

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}

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

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

Jeff Bea

I am an avid globetrotter with my trusty Lufthansa B777F, Polar Air Cargo B744F, and Atlas Air B748F.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.