How to find the airports ICAO

voss1917
Posts: 28
Joined: Sat Sep 23, 2017 10:56 am

How to find the airports ICAO

Postby voss1917 » Tue May 29, 2018 5:23 pm

Hi,
In an C++ app I am developing, I need to find the airport ICAO of the airport I have my airplane on. The airplane can be placed anywhere withing the airport area. I am using SIMCONNECT_RECV_FACILITIES_LIST to get a list all airports in the area. But, how can I make sure that the correct airport can be identified from this list. It must be 100% correct.

User avatar
ronh991
Posts: 723
Joined: Sat Jan 19, 2013 1:46 am
Location: Ontario, Canada

Re: How to find the airports ICAO

Postby ronh991 » Tue May 29, 2018 5:59 pm

Can you not use:

SimConnect_RequestFacilitiesList to get a list of SIMCONNECT_RECV_AIRPORT_LIST, which will contain a list of SIMCONNECT_DATA_FACILITY_AIRPORT structures.

Then compare your aircraft lat/lon with the ICAO lat/lon. Pick the one with the smallest difference between the co-ords.
Ron


Return to “SimConnect Interface Questions”

Who is online

Users browsing this forum: No registered users and 17 guests