But I'm finding that many of the airports (over 100 of them) aren't in the airport-locations.csv file :-\
Is it possible that some airports were inadvertently left out of the csv file?
(or, were they not available from the original database source of the data?)
Here are the details...
The flight data has 346 unique Origin airports, but 157 of these are not in the airport-locations.csv file.
Similarly there are 351 unique Destination airports, but 159 of them are not in the airport-locations.csv file.
Here are my SAS sql queries that determined this:
create table foo1 as select unique origin from asadata.alldata;
NOTE: Table WORK.FOO1 created, with 346 rows and 1 columns.
create table foo2 as select * from foo1 where foo1.origin not in (select unique iata from asadata.locations);
NOTE: Table WORK.FOO2 created, with 157 rows and 1 columns.
create table foo3 as select unique dest from asadata.alldata;
NOTE: Table WORK.FOO3 created, with 351 rows and 1 columns.
create table foo4 as select * from foo3 where foo3.dest not in (select unique iata from asadata.locations);
NOTE: Table WORK.FOO4 created, with 159 rows and 1 columns.
-----
I manually verified a few of these, to make sure they indeed aren't in the csv file...
Here's what one looks like that *is* in the csv file, for example:
$ grep RDU airport-locations.csv
"RDU","raleigh-durham",35.8775,-78.7872,"0435"
And here's where I try to look up several that apparently aren't in the csv file (they get no matches):
$ grep ABE airport-locations.csv
$ grep BGM airport-locations.csv
$ grep FAY airport-locations.csv
$ grep TEX airport-locations.csv
$ grep XNA airport-locations.csv
---
And here's the complete list of all the airports that aren't in the csv file (ie, the complete output of the 2 queries above)...
Airports (origin) in data that are not in airport-locations.csv
Obs Origin
1 ABE
2 ABY
3 ACV
4 ALO
5 ANI
6 APF
7 ASE
8 ATW
9 AVL
10 AVP
11 AZO
12 BFF
13 BGM
14 BIL
15 BIS
16 BJI
17 BMI
18 BQK
19 BQN
20 BTM
21 BZN
22 CAK
23 CCR
24 CEC
25 CHO
26 CID
27 CKB
28 CLD
29 CMI
30 CMX
31 COD
32 CRW
33 CSG
34 CWA
35 DAB
36 DBQ
37 EAU
38 EGE
39 EKO
40 ELM
41 ERI
42 EUG
43 EVV
44 FAR
45 FAY
46 FCA
47 FLG
48 FNT
49 FSD
50 FWA
51 GCC
52 GCN
53 GJT
54 GLH
55 GPT
56 GSO
57 GSP
58 GST
59 GTR
60 GUC
61 GUM
62 HDN
63 HHH
64 HNL
65 HSV
66 HTS
67 HVN
68 IDA
69 ILE
70 ISO
71 ITH
72 ITO
73 IYK
74 JAC
75 KOA
76 KSM
77 LAW
78 LEX
79 LIH
80 LMT
81 LNY
82 LSE
83 LWB
84 LWS
85 LYH
86 MAZ
87 MBS
88 MEI
89 MFR
90 MGM
91 MHT
92 MKC
93 MKG
94 MKK
95 MLI
96 MRY
97 MSO
98 MTH
99 MTJ
100 OAJ
101 OGD
102 OGG
103 ORH
104 OXR
105 PFN
106 PIA
107 PIH
108 PIR
109 PLN
110 PSC
111 PSE
112 PSG
113 PVU
114 RAP
115 RDD
116 RDM
117 RFD
118 RHI
119 RKS
120 ROA
121 ROP
122 ROR
123 RST
124 SBA
125 SBN
126 SBP
127 SCE
128 SDF
129 SGF
130 SGU
131 SJU
132 SLE
133 SMX
134 SOP
135 SPI
136 SPN
137 SRQ
138 STT
139 STX
140 SUN
141 TEX
142 TOL
143 TRI
144 TUP
145 TVC
146 TVL
147 TWF
148 UCA
149 VCT
150 VIS
151 VLD
152 VPS
153 WRG
154 WYS
155 XNA
156 YAP
157 YKM
Airports (dest) in data that are not in airport-locations.csv
Obs Dest
1 ABE
2 ABY
3 ACV
4 ALO
5 ANI
6 APF
7 ASE
8 ATW
9 AVL
10 AVP
11 AZO
12 BFF
13 BGM
14 BIL
15 BIS
16 BJI
17 BMI
18 BQK
19 BQN
20 BTM
21 BZN
22 CAK
23 CCR
24 CEC
25 CHO
26 CID
27 CKB
28 CLD
29 CMI
30 CMX
31 COD
32 CRW
33 CSG
34 CWA
35 DAB
36 DBQ
37 EAU
38 EGE
39 EKO
40 ELM
41 ERI
42 EUG
43 EVV
44 FAR
45 FAY
46 FCA
47 FLG
48 FNT
49 FSD
50 FWA
51 GCC
52 GCN
53 GJT
54 GLH
55 GPT
56 GSO
57 GSP
58 GST
59 GTR
60 GUC
61 GUM
62 HDN
63 HHH
64 HNL
65 HSV
66 HTS
67 HVN
68 IDA
69 ILE
70 ISO
71 ITH
72 ITO
73 IYK
74 JAC
75 KOA
76 KSM
77 LAR
78 LAW
79 LBF
80 LEX
81 LIH
82 LMT
83 LNY
84 LSE
85 LWB
86 LWS
87 LYH
88 MAZ
89 MBS
90 MEI
91 MFR
92 MGM
93 MHT
94 MKC
95 MKG
96 MKK
97 MLI
98 MRY
99 MSO
100 MTH
101 MTJ
102 OAJ
103 OGD
104 OGG
105 ORH
106 OXR
107 PFN
108 PIA
109 PIH
110 PIR
111 PLN
112 PSC
113 PSE
114 PSG
115 PVU
116 RAP
117 RDD
118 RDM
119 RFD
120 RHI
121 RKS
122 ROA
123 ROP
124 ROR
125 RST
126 SBA
127 SBN
128 SBP
129 SCE
130 SDF
131 SGF
132 SGU
133 SJU
134 SLE
135 SMX
136 SOP
137 SPI
138 SPN
139 SRQ
140 STT
141 STX
142 SUN
143 TEX
144 TOL
145 TRI
146 TUP
147 TVC
148 TVL
149 TWF
150 UCA
151 VCT
152 VIS
153 VLD
154 VPS
155 WRG
156 WYS
157 XNA
158 YAP
159 YKM
-------------------------------------
Robert Allison, PhD
Robert....@sas.com
Thanks for bringing this up. I'll try and look into this in the next
couple of days, but in case you want to do your own investigation I've
attached the original data (from
http://www.partow.net/miscellaneous/airportdatabase/index.html, found
googling for airport lat long or something similar) and the R script I
used to clean it up. It's possible the original data is lacking (or
incorrect), so if you find a better source please let me know.
Otherwise there may be a bug in my R script - you should be able to
follow the logic even if you're not familiar with R.
Hadley
It looks like http://www.faa.gov/airports_airtraffic/airports/airport_safety/airportdata_5010/
might be a better source (it has 20,000 airports in the US alone!).
I'll try and update the data on the website in the next couple of
days.
Hadley
That looks great, thanks! Does it match all of the locations in the
flight table?
Hadley
This is interesting! It looks like Ryan got most of those, but there
are still a few missing. It's interesting what is considered a US
commercial airport!
Hadley