Page 1 of 1

How to find the airports ICAO

Posted: Tue May 29, 2018 5:23 pm
by voss1917
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.

Re: How to find the airports ICAO

Posted: Tue May 29, 2018 5:59 pm
by ronh991
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.