datasets / airport-codes Goto Github PK
View Code? Open in Web Editor NEWList of Airport codes, locations and other information around the world
Home Page: https://datahub.io/core/airport-codes
List of Airport codes, locations and other information around the world
Home Page: https://datahub.io/core/airport-codes
Airport with code AU-0119 contains a spam text.
(starts with How to Join the Illuminati...)
This is https://en.wikipedia.org/wiki/EuroAirport_Basel_Mulhouse_Freiburg
Actually LSZM and LFSB are the same and LFSB is in the dataset
Some airports have incorrect ident, iata and local code :
To identify them , search for 'E+' in the file (probably due to an excel import and automatic conversion.). The original file from http://ourairports.com/data/ is correct though.
The airports are :
0.00E+00,small_airport,Corydon Airport,"-93.24130249, 40.75450134",1020,NA,US,US-IA,Corydon,0.00E+00,,0.00E+00
1.00E+02,small_airport,Terlingua Ranch Airport,"29.45019913, -103.3990021",3769,NA,US,US-TX,Alpine,1.00E+02,,1.00E+02
1.00E+04,small_airport,Palo Duro Airport,"35.14199829, -101.8379974",3639,NA,US,US-TX,Amarillo,1.00E+04,,1.00E+04
1.00E+06,small_airport,Elkins Field,"34.45780182, -78.61830139",93,NA,US,US-NC,Clarkton,1.00E+06,,2NR2
1.00E+07,small_airport,Buffalo Airport,"35.06499863, -101.8789978",3640,NA,US,US-TX,Amarillo,1.00E+07,,1.00E+07
1.00E+08,small_airport,Moores Airport,"44.38759995, -75.06629944",814,NA,US,US-NY,Degrasse,1.00E+08,,1.00E+08
1.00E+09,small_airport,Maples Field,"35.06529999, -101.9609985",3677,NA,US,US-TX,Canyon,1.00E+09,,1.00E+09
This can be included in the project's code base, if interest.
#!/usr/bin/perl
use warnings;
use strict;
use Text::CSV; # http://search.cpan.org/~ishigaki/Text-CSV-1.95/lib/Text/CSV.pm
use Carp; # http://search.cpan.org/~rjbs/Carp-1.38/lib/Carp.pm
my $airportsFile = 'airport-codes.csv';
my $onlyIcao = 1;
my $quiet = 1;
# >>>>
my $airports = readAirports($airportsFile,$onlyIcao,$quiet);
# <<<<
if (! defined $airports) {
print STDERR "No result obtained!\n";
}
else {
for my $key (sort(keys(%$airports))) {
my $val = $$airports{$key}; # this is a hashref
print $$val{ident},"\n";
for my $subkey (sort(keys(%$val))) {
if ($subkey ne 'ident') {
print sprintf("%15s = %s\n",$subkey,$$val{$subkey})
}
}
}
}
# ===
# Read the CSV file of airport records.
# Returns a hashref if all went well, or undef if not!
# ===
sub readAirports {
my($airportsFile,$onlyIcao,$quiet) = @_;
my @rows;
my $csv = Text::CSV->new ( { binary => 1 } ) or croak "Cannot use Text::CSV: " . Text::CSV->error_diag();
my $fh;
unless (open($fh, "<:encoding(utf8)", $airportsFile)) {
print STDERR "Could not open file '$airportsFile': $!\n";
return undef
}
print STDERR "Reading airport information from file '$airportsFile'...\n";
my $count = -1;
my $headers;
my $airports = {};
while (my $row = $csv->getline($fh)) {
$count++;
if ($count == 0) {
# first entry consists of headers
$headers = $row;
}
else {
# transform record into a map of key -> value pairs
my $airport = {};
for my $header (@$headers) {
$$airport{$header} = $$row[0];
shift @$row;
}
my $ident = $$airport{ident}; # "ident" may or may not be ICAO code
if ($onlyIcao && (!($ident =~ /^[A-Z]{4}$/) || $ident eq 'ZZZZ')) {
print STDERR "Ident '$ident' is definitely not an ICAO code -- skipping\n" unless $quiet;
}
else {
# retain
croak "Clash on airport identifier '$ident'" if exists $$airports{$ident};
my $name = $$airport{name};
$$airports{$ident} = $airport;
}
if ($count % 5000 == 0) {
print STDERR "$count airports read so far...\n"
}
}
}
$csv->eof or $csv->error_diag();
close $fh or carp "Could not close file '$airportsFile: $!";
print STDERR "$count airports read in total, " . scalar(keys %$airports) . " retained!\n";
return $airports
}
Invalid geopoint type latitude should be between -90 and 90, found: -151.6959991
it's not a valid geopoint according to the specs:
Geopoint type is a string of the pattern "lon, lat"
In airport-codes.csv
geopoint column has a "lat, lon" format which is in reverse order. So a latitude with a value -151.6959991 is invalid.
See the following issue in tableschema-js
frictionlessdata/tableschema-js#72
In this datapackage geopoints are in "lat,lon" form instead of "lon,lat" form (see order) as per spec.
Spam entries somehow were injected into the current data/airport-codes.csv file. I verified this against the current version taken from https://github.com/datasets/airport-codes/blob/master/data/airport-codes.csv
See these three entries, though there may be others:
US-0878,small_airport,Buy Generic Cytotec Online Without A Prescription. Buy Cytotec Online 100 mg fast free delivery,,NA,US,US-NY,,,,,"3, 1"
US-0879,medium_airport,Buy Lyrica online (Pregabalin) 150mg capsules without prescription. Buy lyrica online.,,NA,US,US-U-A,,,,,"3.1666666666667, -1.1666666666667"
US-0880,medium_airport,"Buy Lyrica online. Discount Lyrica 75 mg online. Buy Lyricaa Uk, Canada, AUSTRALIA",0,NA,US,US-U-A,,,,,"-2.1666666666667, -2.1666666666667"
The most recent CSV file available on https://datahub.io/core/airport-codes (from ~6 months ago) has unicode encoding errors.
One example, from a diff of an older version to the latest one:
-MMCC,small_airport,Ciudad Acuña New International Airport,1410,NA,MX,MX-COA,Ciudad Acuña,MMCC,ACN,EFN,"29.332899, -101.098998"
+MMCC,small_airport,Ciudad Acuña New International Airport,1410,NA,MX,MX-COA,Ciudad Acuña,MMCC,ACN,EFN,"-101.098998, 29.332899"
Looks like the source input was treated as Latin-1 rather than UTF-8?
How is this data updated? The source site has many additions that this data set does not contain...
I did some work in a fork to update the data, but I'm not sure if there is another process for maintaining...
Related: #9
No problem in the source http://ourairports.com/data/, but in http://data.okfn.org/data/core/airport-codes#data, some airports have a wrong identifier and iata code and local code.
I can propose a corrected file, but how can I do that ?
please help.
Where is the problem ?
Easy to identify, search for 'E+' in the file (probably due to an excel import and automatic conversion...) :
0.00E+00,small_airport,Corydon Airport,"-93.24130249, 40.75450134",1020,NA,US,US-IA,Corydon,0.00E+00,,0.00E+00
1.00E+02,small_airport,Terlingua Ranch Airport,"29.45019913, -103.3990021",3769,NA,US,US-TX,Alpine,1.00E+02,,1.00E+02
1.00E+04,small_airport,Palo Duro Airport,"35.14199829, -101.8379974",3639,NA,US,US-TX,Amarillo,1.00E+04,,1.00E+04
1.00E+06,small_airport,Elkins Field,"34.45780182, -78.61830139",93,NA,US,US-NC,Clarkton,1.00E+06,,2NR2
1.00E+07,small_airport,Buffalo Airport,"35.06499863, -101.8789978",3640,NA,US,US-TX,Amarillo,1.00E+07,,1.00E+07
1.00E+08,small_airport,Moores Airport,"44.38759995, -75.06629944",814,NA,US,US-NY,Degrasse,1.00E+08,,1.00E+08
1.00E+09,small_airport,Maples Field,"35.06529999, -101.9609985",3677,NA,US,US-TX,Canyon,1.00E+09,,1.00E+09
That is Hamad International Airport
https://en.wikipedia.org/wiki/Hamad_International_Airport
Well, it is in there but with:
ident = QA-0001 (this seems to be a placeholder; it does not look like an ICAO code at all; one finds it in use around the web, but I would they these sites are using this very dataset)
gps_code = OTHH (this is the ICAO code)
iata_code = DOH (correct IATA code)
This is https://en.wikipedia.org/wiki/Manas_International_Airport
ICAO: UCFM, formerly UAFM.
UAFM is in the dataset, but not UCFM.
As is the custom, "UCFM" can be found in "gps_code" instead.
This is https://en.wikipedia.org/wiki/Guelmim_Airport
The "ident" is given as "MA-GLN", the ICAO code is in the "gps_code" field instead.
https://en.wikipedia.org/wiki/Williston_Basin_International_Airport
Airport opened on October 10, 2019.
(IATA: XWA, ICAO: KXWA, FAA LID: XWA)
Syntax, there should be space ### Header not ###header
https://en.wikipedia.org/wiki/Prince_Abdul_Majeed_bin_Abdulaziz_Domestic_Airport
The ident is "ULH" (which is the IATA code), the ICAO code can be found in te "gps_code" field
Geopoint type supports in the followings formats:
Please, correct to the right format.
https://en.wikipedia.org/wiki/Princess_Juliana_International_Airport
I'm not entirely sure which is correct, but any clarification should be appreciated. Islands that have split country ownership are always a problem in situations like this.
This is https://en.wikipedia.org/wiki/Logro%C3%B1o%E2%80%93Agoncillo_Airport
Is is found with ident = LELO instead, which apparently is the military airport of the same name.
The ICAO code LERJ can be found in the gps_code field of LELO instead.
https://en.wikipedia.org/wiki/List_of_airports_by_ICAO_code:_L#LE_%E2%80%93_Spain
See: #11 (original: https://discuss.okfn.org/t/error-in-file-http-data-okfn-org-data-core-airport-codes-data/5734/2)
No problem in the source http://ourairports.com/data/, but in http://data.okfn.org/data/core/airport-codes#data, some airports have a wrong identifier and iata code and local code.
I can propose a corrected file, but how can I do that ?
please help.
Where is the problem ?
Easy to identify, search for 'E+' in the file (probably due to an excel import and automatic conversion...) :
0.00E+00,small_airport,Corydon Airport,"-93.24130249, 40.75450134",1020,NA,US,US-IA,Corydon,0.00E+00,,0.00E+00
1.00E+02,small_airport,Terlingua Ranch Airport,"29.45019913, -103.3990021",3769,NA,US,US-TX,Alpine,1.00E+02,,1.00E+02
1.00E+04,small_airport,Palo Duro Airport,"35.14199829, -101.8379974",3639,NA,US,US-TX,Amarillo,1.00E+04,,1.00E+04
1.00E+06,small_airport,Elkins Field,"34.45780182, -78.61830139",93,NA,US,US-NC,Clarkton,1.00E+06,,2NR2
1.00E+07,small_airport,Buffalo Airport,"35.06499863, -101.8789978",3640,NA,US,US-TX,Amarillo,1.00E+07,,1.00E+07
1.00E+08,small_airport,Moores Airport,"44.38759995, -75.06629944",814,NA,US,US-NY,Degrasse,1.00E+08,,1.00E+08
1.00E+09,small_airport,Maples Field,"35.06529999, -101.9609985",3677,NA,US,US-TX,Canyon,1.00E+09,,1.00E+09
e.g. KBVT is not in the dataset.
This is for https://en.wikipedia.org/wiki/Issyk-Kul_International_Airport
The ident is "UAFL" (not an ICAO code), the ICAO code is in the "gps_code" field
https://en.wikipedia.org/wiki/Kenneth_Kaunda_International_Airport
The ident is "FLLS"
The ICAO code "FLKK" can be found in the "gps_code"
It would be nice to also have the IACA codes for country and cities other than just airports. I am just going to extract this data from an API instead, but I think it would be a good addition for this. I can PR the information later when I get it extracted.
It's not in there at all:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.