Board index FlightGear Development

Enhancement Request: Allow IATA airport/region codes

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Enhancement Request: Allow IATA airport/region codes

Postby jharris1993 » Wed Jan 25, 2017 7:56 pm

Greetings!

This enhancement request is a "it would be nice to have. . . ." class of enhancement request. As a result I don't know if I should add additional noise to the Dev mailing list by posting it.

Issue:
I am assuming that one of the goals of FG is to get more people to use it, regardless of their experience with planes, flying, etc. etc. etc.

This being the case, ICAO airport codes are relatively unknown, whereas anyone who flies more than once a century knows at least a few IATA airport codes.
(i.e. "JFK" for John F. Kennedy airport in New York, "BOS" for Boston Logan, "LAX" for Los Angeles, "SVO" and "DME" for Sheremetyevo and Domodedovo airports in Moscow, etc.)

In fact, the airports themselves often use their IATA codes for "branding" purposes - an excellent example of this is Los Angeles International Airport which has a gigantic "LAX" sign out in front of the airport where you drive in. Other airports do the same thing. If you've lived in the NY metro area for any length of time, you know that most people refer to Kennedy airport as "JFK".

The current behavior is to ask for the "ICAO code, navaid or name". ICAO codes and navaid names are only known to that prestigious elite who live and breathe airplanes. This is mitigated to some extent by the fact that the ICAO code for many airports in the U.S. is the IATA code with a "K" prefix, (kbos for Boston Logan, korh for Worcester Regional, (ORH), etc.

What is fortunate for the traveling public, (and fatal to that scheme!), is that most airports are not in the U.S. Unless you already knew the answer, how would anyone possibly guess that "UUEE" is the ICAO code for Sheremetyevo airport in Moscow?

The name of the place, though seemingly obvious, has problems especially if the name is not native. (For example, I may not spell Sheremetyevo or Domodedovo correctly. If I miss-spell them, FG can't find them.)

A desirable behavior, especially desirable for beginners, is to allow for the use of the three-letter IATA codes for airports, (JFK, BOS, SVO), or regions, (NYC is an alias for JFK, LGA, and EWR - Kennedy, LaGuardia, and Newark airports, all in the NYC area. MOW is the alias for all the important airports in the Moscow region, etc.)

I admit that I can also search by region, city, country, etc. etc. etc. And this is a Good Thing. My thinking is that if we want to help the beginner get "up and flying" as quickly and conveniently as possible, then allowing them to choose an airport based on the airport codes they already know would be great.

Obviously the world won't stop spinning if this isn't implemented in the next seventeen seconds or so. . . . :wink:

Is this something even worth discussing? Should I pester the dev mailing list with this?

What say ye?

Jim (JR)
What say ye?

Jim (JR)

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
jharris1993
 
Posts: 139
Joined: Sun Nov 18, 2012 9:20 pm
Location: Worcester, MA. / Moscow, Russia
Callsign: $%^&ing Idiot!
Version: Whatever..
OS: Win-7 / Linux

Re: Enhancement Request: Allow IATA airport/region codes

Postby Hooray » Wed Jan 25, 2017 8:03 pm

As long as we can obtain (not create) a corresponding list that maps IATA to ICAO codes, that would be dead-easy to implement - e.g. using 10 lines of nasal code, or even using an online web API.

The main thing is gathering the list/mapping (and who knows, maybe the navcache already contains such data??)

But from an implementation standpoint, it's really easy to implement once you have that list, and all it requires is a little Nasal code snippet to translate IATA to ICAO for you.


I admit that I can also search by region, city, country, etc. etc. etc. And this is a Good Thing. My thinking is that if we want to help the beginner get "up and flying" as quickly and conveniently as possible, then allowing them to choose an airport based on the airport codes they already know would be great.


That, too, would be possible to implement - but a little more complex, in that we'd need access to ESRI shapefiles in FlightGear and process those to filter by continent/country/region etc - the osgearth branch maintained by poweroftwo already contains GDAL/OGR bindings, so that exposing those to Nasal via cppbind to make this possible, would not be far-fetched or difficult to implement.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11004
Joined: Tue Mar 25, 2008 8:40 am

Re: Enhancement Request: Allow IATA airport/region codes

Postby jharris1993 » Wed Jan 25, 2017 9:26 pm

Hooray wrote in Wed Jan 25, 2017 8:03 pm:
I admit that I can also search by region, city, country, etc. etc. etc. And this is a Good Thing. My thinking is that if we want to help the beginner get "up and flying" as quickly and conveniently as possible, then allowing them to choose an airport based on the airport codes they already know would be great.


That, too, would be possible to implement - but a little more complex, in that we'd need access to ESRI shapefiles in FlightGear and process those to filter by continent/country/region etc - the osgearth branch maintained by poweroftwo already contains GDAL/OGR bindings, so that exposing those to Nasal via cppbind to make this possible, would not be far-fetched or difficult to implement.


Hooray,

Sorry if I was not clear. The ability to search by region, city, etc., already exists and I was acknowledging that.

A correspondence between ICAO and IATA codes probably exists somewhere. . . Oh, I remember! There's a list on Wikipedia.
(Viz., https://en.wikipedia.org/wiki/List_of_airports_by_IATA_code:_A)

There are twenty-some-odd pages since there is one page for every letter of the English alphabet.

One thing I notice here is that they show airports that have IATA codes, but do not have ICAO codes.

On the page for the letter "A", there are a whole bunch. (This is the first few - there are a lot more on that page that I did not list.)
Viz.,
Code: Select all
AAS     Apalapsili Airport       Apalapsili, Indonesia
ABP     Atkamba Airport          Atkamba, Papua New Guinea
ACL     Aguaclara Airport        Aguaclara, Colombia
ACU     Achutupo Airport         Achutupo, Panama
ADV     Ed Daein Airport         Ed Daein, Sudan
AEE     Adareil Airport          Adareil, South Sudan
AGW     Agnew Airport            Agnew, Queensland, Australia
AHD     Ardmore Downtown Executive Airport (FAA: 1F0)     Ardmore, Oklahoma, United States
AHF     Arapahoe Municipal Airport (FAA: 37V)             Arapahoe, Nebraska, United States
AHM     Ashland Municipal Airport  Ashland, Oregon, United States

<snip rest of long list>


Though some are on tiny atolls out in the mid-Pacific, there are a number in the U.S., Australia, etc. as well. Since these don't have ICAO codes, they are not directly selectable.

Jim (JR)
What say ye?

Jim (JR)

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
jharris1993
 
Posts: 139
Joined: Sun Nov 18, 2012 9:20 pm
Location: Worcester, MA. / Moscow, Russia
Callsign: $%^&ing Idiot!
Version: Whatever..
OS: Win-7 / Linux

Re: Enhancement Request: Allow IATA airport/region codes

Postby Johan G » Thu Jan 26, 2017 7:53 pm

jharris1993 wrote in Wed Jan 25, 2017 7:56 pm:The current behavior is to ask for the "ICAO code, navaid or name". ICAO codes and navaid names are only known to that prestigious elite who live and breathe airplanes.

Like most flight sim geeks (though admittedly not all) and pretty much all real life pilots. ;)
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5255
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Enhancement Request: Allow IATA airport/region codes

Postby zakalawe » Fri Jan 27, 2017 12:11 pm

Personally I picked up the ICAO codes by searching, but it would be easy to add a mapping to IATA codes. We would need a GPL compatible data file, in plain text, XML or CSV, which could be loaded. Nothing too onerous there, if someone wants to supply such a thing. Adding region / city information would be very useful, but that requires considerably more data, and brings up character encoding issues (do we use English names, local names, support many names for each city/region? How if so?)
zakalawe
 
Posts: 1138
Joined: Sat Jul 19, 2008 4:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Enhancement Request: Allow IATA airport/region codes

Postby jharris1993 » Fri Jan 27, 2017 8:01 pm

Not city/region names, city/region codes.
Viz.
NYC would bring up JFK, LGA and EWR as choices.
MOS would bring up SVO, DME and VKO.
Etc.

Jim (JR)

p.s. What should that data file look like?
What say ye?

Jim (JR)

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
jharris1993
 
Posts: 139
Joined: Sun Nov 18, 2012 9:20 pm
Location: Worcester, MA. / Moscow, Russia
Callsign: $%^&ing Idiot!
Version: Whatever..
OS: Win-7 / Linux

Re: Enhancement Request: Allow IATA airport/region codes

Postby zakalawe » Fri Jan 27, 2017 10:37 pm

Two parts to the data:

First part, IATA -> IACO mappings, should be a file "iata.map" or similar, with the following:

EDI EGPH
LHR EGLL
MUN EDDM

note you can probably omit the US entries, because they are simply a K prefix.

For the cities and locations, I would do a file like:

NYC <lat-deg> <lon-deg> <optional view range in NM>
MOS <lat> <lon> range in NM

The idea here being we would center the map on the specified lat/lon, with the zoom range set accordingly to show all the area. With quoted text support, this would allow us to do load in city / region data also:

"London" <lat> <lon> <range>
"Sao Paulo" ... etc

Now the only thing this doesn't do, is let is default select an airport within the area, this could be done automatically (closest to the specified lat/lon point) or explicitly with another term

"London" <lat> <lon> <range> EGLL

(so Heathrow would be the default even though EGLC is likely closer)
zakalawe
 
Posts: 1138
Joined: Sat Jul 19, 2008 4:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Enhancement Request: Allow IATA airport/region codes

Postby pommesschranke » Fri Jan 27, 2017 10:41 pm

newer versions of apt.dat.gz contain IATA codes for some airports.
example:

1 354 1 0 EDDF Frankfurt am Main
1302 city Frankfurt-am-Main
1302 country Germany
1302 datum_lat 50.033305556
1302 datum_lon 8.570455556
1302 faa_code
1302 iata_code FRA
1302 icao_code EDDF
1302 region_code ED
1302 state Hesse
1302 transition_alt 5000

pommesschranke
 
Posts: 1092
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 14.04

Re: Enhancement Request: Allow IATA airport/region codes

Postby zakalawe » Fri Jan 27, 2017 11:18 pm

Ah that would be a much better solution, any idea how wide the coverage is? having all that data available per airport would be exceedingly useful, especially the country and city information.
zakalawe
 
Posts: 1138
Joined: Sat Jul 19, 2008 4:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Enhancement Request: Allow IATA airport/region codes

Postby D-ECHO » Sat Jan 28, 2017 9:33 am

pommesschranke wrote in Fri Jan 27, 2017 10:41 pm:
1302 state Hesse


Are we going into dialect now? ;)
User avatar
D-ECHO
 
Posts: 1304
Joined: Sat May 09, 2015 12:31 pm

Re: Enhancement Request: Allow IATA airport/region codes

Postby jharris1993 » Sat Jan 28, 2017 10:15 am

If I can get that file I can fill in whats missing.

Update:

Can these files create, or handle aliases? That is an IATA code that references other IATA codes? If not, well it's not a deal breaker, but a desirable behavior would be something like this:

Case 1. Enter "JFK" - Result is you are taken direct to JFK airport in New York City.
Case 2. Enter "NYC" - Result is a list of the three major airports in the NYC area: JFK, LGA and EWR. where the user can choose the one he wants.

Depending on how FG handles this, it could be one-to-many IATA code mapping, or a single IATA code that maps to several ICAO codes. Can we map a single entry to multiple IACO codes at the same time? Or, maybe, translate a region IATA code to a query by name? (i.e. "MOW" would translate to a name query for "Moscow, Russia" and "NYC" would translate to a name query for "New York City" - etc.)

What about the cases where there is an IATA code but no ICAO code? There are a number of airports that fall into that category. This leads to yet Another Musical Question: What is the primary index into the list of airports that FG knows about? If it's the ICAO code, does than mean airports without ICAO codes simply "don't exist" in FG-land?

On a completely different note: I discovered a fourth airport in the Moscow area today: ZIA (Zhukovsky Airport, aka, UUBW) There's a nice site with a satellite view over at https://www.flightradar24.com/data/airports/zia It has been added to the Moscow Metro (subway) map as an airport you can get to, along with SVO, DME, and VKO, and I just noticed it today. (That doesn't mean it was just added today - I don't use the Metro that often anymore.)

What say ye?

Jim (JR)
What say ye?

Jim (JR)

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
jharris1993
 
Posts: 139
Joined: Sun Nov 18, 2012 9:20 pm
Location: Worcester, MA. / Moscow, Russia
Callsign: $%^&ing Idiot!
Version: Whatever..
OS: Win-7 / Linux

Re: Enhancement Request: Allow IATA airport/region codes

Postby jharris1993 » Sat Jan 28, 2017 2:29 pm

pommesschranke wrote in Fri Jan 27, 2017 10:41 pm:newer versions of apt.dat.gz contain IATA codes for some airports.


Does that mean these airports are, (or should be), searchable by IATA codes? Or is that in there "just for the heck of it".

Jim (JR)
What say ye?

Jim (JR)

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb
jharris1993
 
Posts: 139
Joined: Sun Nov 18, 2012 9:20 pm
Location: Worcester, MA. / Moscow, Russia
Callsign: $%^&ing Idiot!
Version: Whatever..
OS: Win-7 / Linux

Re: Enhancement Request: Allow IATA airport/region codes

Postby wkitty42 » Sun Jan 29, 2017 8:41 pm

Hooray wrote in Wed Jan 25, 2017 8:03 pm:As long as we can obtain (not create) a corresponding list that maps IATA to ICAO codes, that would be dead-easy to implement - e.g. using 10 lines of nasal code, or even using an online web API.

i found a site the other week that has information like this we might be able to make use of... what i downloaded was a CSV file so that i could try to correlate old ICAOs with new ones like when airports change their's... i figured a spreadsheet would be easy for me to use for this purpose but there's a lot more information in the file, too... i downloaded the following 7.3MB file...

http://ourairports.com/data/airports.csv

for the curious, here are the fields in the CSV...
Code: Select all
"id","ident","type","name","latitude_deg","longitude_deg","elevation_ft","continent","iso_country","iso_region","municipality","scheduled_service","gps_code","iata_code","local_code","home_link","wikipedia_link","keywords"


while i was pulling it down, i nosed around the site a little bit and was surprised to find a name associated with flightgear... an inquiry turned up a positive result that it was the same individual ;)

so anyway, if a list doesn't already exist, one can surely be built from this :)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 3764
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5


Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests