fpw / avitab

X-Plane plugin that displays a tablet to aid VR usage
GNU Affero General Public License v3.0
299 stars 58 forks source link

AviTab incorrectly uses ID instead of ICAO code #208

Open fpw opened 2 months ago

fpw commented 2 months ago

Airports in X-Plane have two kinds of IDs: an internal airport ID and an optional (!) ICAO code.

The airport ID is given with rowcode 1 in column 5:

1 55 0 0 EDHL Luebeck Blankensee

And the ICAO code is optionally given with rowcode 1302:

1302 icao_code EDHL

For 99% of the airports, the ID is the same. But there are some new airports that were added to the scenery before the ICAO code was assigned, for example RPLK:

1 317 0 0 XRP0042 Bicol Intl 1302 icao_code RPLK

AviTab uses XRP0042 as internal ID, so the airport can't be found when searching for RPLK. And when searched as "Bicol", it can be found but there are no charts since XRP0042 is used to query the navdata providers.

As a fix, I think AviTab should introduce a kind of search key for airports that's set to the ID by default but overridden with the ICAO code if present. And when querying the providers, the ICAO code should always be used.