jpatokal / openflights

Website for storing flight information, rendering paths on a zoomable world map and calculating statistics, with plenty of free airline, airport and route data.
http://openflights.org
GNU Affero General Public License v3.0
1.38k stars 389 forks source link

Inconsistent formatting for empty/missing IATA and ICAO airport codes #331

Open chealy opened 9 years ago

chealy commented 9 years ago

In the following example, (and many others), you will see that there is no IATA and ICAO code. In the case of the IATA code, there's "" whereas in the case of the ICAO code, there's \N.

According to the description on the website, in the absence of each of these codes, it should be: "Blank if not assigned.". The "" makes sense, but the \N does not. Shouldn't the ICAO code be "" when there is no assigned ICAO code?

4211,"Heliport Hotel das Cataratas","Cataratas National Park","Brazil","",\N,-25.684,-54.44024,1000,-3,"S","America/Cordoba"

jpatokal commented 9 years ago

\N is MySQL's standard representation for NULL values in CSV: https://dev.mysql.com/doc/refman/5.0/en/null-values.html

However, there is indeed an inconsistency between the treatment of missing IATA and ICAO values, which has been on my to-do list for a while -- although I was planning to go in the other direction and tag missing IATAs with \N as well. Maybe just a blank column would be the best option.

chealy commented 9 years ago

Thank you for the explanation.

Is this something I can help you fix? I'm more than willing to make the necessary changes and provide you a patch.

On Tue, Jun 30, 2015 at 2:48 PM, Jani Patokallio notifications@github.com wrote:

\N is MySQL's standard representation for NULL values in CSV: https://dev.mysql.com/doc/refman/5.0/en/null-values.html

However, there is indeed an inconsistency between the treatment of missing IATA and ICAO values, which has been on my to-do list for a while -- although I was planning to go in the other direction and tag missing IATAs with \N as well. Maybe just a blank column would be the best option.

— Reply to this email directly or view it on GitHub https://github.com/jpatokal/openflights/issues/331#issuecomment-117354705 .

jpatokal commented 9 years ago

The complication is that it's not enough to fix the data, I also need to fix the website code to handle the change consistently throughout. Not difficult, just fiddly, because the airport tables are referenced a million times.

burkhartt commented 9 years ago

IATA code for Cabo San Lucas is missing. It should be CSL but is empty string.

jpatokal commented 9 years ago

Note to self: after switching IATA to be consistently null, add a UNIQUE index on both this and ICAO.