2
2
library(sf )
3
3
library(dplyr )
4
4
5
- pass_od <- readRDS(" data/clean/passenger_od_first_clean .Rds" )
6
- flight_od <- readRDS(" data/clean/flighs_od_first_clean .Rds" )
7
- airports <- read_sf(" data/clean/airports_clean_first_pass .gpkg" )
5
+ pass_od <- readRDS(" data/clean/passenger_od_first_clean_v2 .Rds" )
6
+ flight_od <- readRDS(" data/clean/flighs_od_first_clean_v2 .Rds" )
7
+ airports <- read_sf(" data/clean/airports_clean_first_pass_v2 .gpkg" )
8
8
airports <- airports [airports $ airport != " Vary (Chalons Sur Marne)" ,]
9
9
10
- airports_extra <- data.frame (airport = c(" Tabarka" ," St Maarten" ," Sydney Canada" ," Lanseria" ," Izmir (Cumaovasi)" ),
11
- country = c(" Tunisia" ," St Maarten" ," Canada" ," Republic of South Africa" ," Turkey" ),
10
+ airports_extra <- data.frame (airport = c(" Tabarka" ," St Maarten" ," Sydney Canada" ," Lanseria" ," Izmir (Cumaovasi)" , " Islamabad " ),
11
+ country = c(" Tunisia" ," St Maarten" ," Canada" ," Republic of South Africa" ," Turkey" , " Pakistan " ),
12
12
geometry = st_sfc(list (
13
13
st_point(c(8.876944 , 36.98 )),
14
14
st_point(c(- 63.109444 , 18.040833 )),
15
15
st_point(c(- 60.048056 , 46.161389 )),
16
16
st_point(c(27.926111 , - 25.938611 )),
17
- st_point(c(27.33114 , 37.95034 ))
17
+ st_point(c(27.33114 , 37.95034 )),
18
+ st_point(c(72.82565 , 33.549083 ))
18
19
)))
19
20
names(airports_extra ) <- names(airports )
20
21
@@ -29,7 +30,7 @@ airports$geom[airports$airport == "Seoul Afb"] <- st_point(c(127.113889, 37.4458
29
30
airports $ geom [airports $ airport == " Seoul (Kimpo)" ] <- st_point(c(126.790556 , 37.558056 ))
30
31
airports $ geom [airports $ airport == " Tollerton Nottingham" ] <- st_point(c(- 1.080855 , 52.91872 ))
31
32
airports $ geom [airports $ airport == " Vagar" ] <- st_point(c(- 7.27546 , 62.06333 ))
32
- airports $ geom [airports $ airport == " Benazir Bhutto" ] <- st_point(c(72.83501 , 33.55693 ))
33
+ airports $ geom [airports $ airport == " Benazir Bhutto" ] <- st_point(c(73.099167 , 33.616389 ))
33
34
airports $ geom [airports $ airport == " Hong Kong" ] <- st_point(c(113.9185 , 22.30805 ))
34
35
airports $ geom [airports $ airport == " Camp Springs (Andrews Afb)" ] <- st_point(c(- 76.88363 , 38.79652 ))
35
36
airports $ geom [airports $ airport == " Oil Rigs" ] <- st_point(c(0.953009 , 58.238252 ))
@@ -127,6 +128,37 @@ tidy_airports("Bursa/Yenisehir","Bursa Yenisehir")
127
128
tidy_airports(" Corlu (Afb)" ," Tekirdag (Corlu)" )
128
129
tidy_airports(" Cagliari" ," Cagliari (Elmas)" )
129
130
131
+ tidy_airports(" Los Angeles International" ," Los Angeles" )
132
+ tidy_airports(" Abu Dhabi International" ," Abu Dhabi" )
133
+ tidy_airports(" Miami International" ," Miami" )
134
+ tidy_airports(" Philadelphia International" ," Philadelphia" )
135
+
136
+ tidy_airports(" Denver International" ," Denver" )
137
+ tidy_airports(" Benazir Bhutto International" ," Benazir Bhutto" )
138
+ tidy_airports(" Guangzhou Baiyun International" ," Guangzhou Baiyun" )
139
+ tidy_airports(" Halifax Int" ," Halifax" )
140
+ tidy_airports(" Ottawa International" ," Ottawa" )
141
+ tidy_airports(" Tarbes-Lourdes International" ," Tarbes-Lourdes" )
142
+ tidy_airports(" Islamabad International" ," Islamabad" )
143
+ tidy_airports(" Jakarta (Soekarno-Hatta Intnl)" ," Jakarta (Soekarno-Hatta)" )
144
+ tidy_airports(" Jakarta (Soekarno-Hattanl)" ," Jakarta (Soekarno-Hatta)" )
145
+ tidy_airports(" Changsha Huanghua International" ," Changsha Huanghua" )
146
+ tidy_airports(" Wuhan Tianhe International" ," Wuhan Tianhe" )
147
+
148
+ tidy_airports(" Male International" ," Male" )
149
+ tidy_airports(" Chongqing Jiangbei International" ," Chongqing Jiangbei" )
150
+ tidy_airports(" Auckland International" ," Auckland" )
151
+ tidy_airports(" Phu Quoc International" ," Phu Quoc" )
152
+ tidy_airports(" Sanya Phoenix International" ," Sanya Phoenix" )
153
+ tidy_airports(" Kharkov Osnova Intl" ," Kharkov Osnova" )
154
+ tidy_airports(" Windsor Locks Bradley Intl" ," Windsor Locks Bradley" )
155
+ tidy_airports(" East Midlands International" ," East Midlands" )
156
+ tidy_airports(" Nottingham East Midlands Int'l" ," East Midlands" )
157
+ tidy_airports(" Manston (Kent Int)" ," Kent" )
158
+ tidy_airports(" Bali International" ," Bali" )
159
+ tidy_airports(" Minot International" ," Minot" )
160
+ tidy_airports(" Erbil International" ," Erbil" )
161
+
130
162
131
163
pass_od $ airport2_country [pass_od $ airport2 == " Pristina" ] <- " Kosovo"
132
164
pass_od $ airport2_country [pass_od $ airport2 == " Bahrain" ] <- " Bahrain"
@@ -195,11 +227,11 @@ res <- res[lengths(res) != 0]
195
227
196
228
197
229
all_od <- full_join(pass_od2 , flight_od2 , by = c(" airport1" ," airport1_country" ," airport2" ," airport2_country" ) )
198
- saveRDS(all_od ," data/clean/pass_flighs_od .Rds" )
199
- saveRDS(pass_od2 , " data/clean/passenger_od_second_clean .Rds" )
200
- saveRDS(flight_od , " data/clean/flighs_od_second_clean .Rds" )
230
+ saveRDS(all_od ," data/clean/pass_flighs_od_v2 .Rds" )
231
+ saveRDS(pass_od2 , " data/clean/passenger_od_second_clean_v2 .Rds" )
232
+ saveRDS(flight_od , " data/clean/flighs_od_second_clean_v2 .Rds" )
201
233
airports <- airports [! duplicated(airports ),]
202
- write_sf(airports , " data/clean/airports_clean_second_pass .gpkg" )
234
+ write_sf(airports , " data/clean/airports_clean_second_pass_v2 .gpkg" )
203
235
204
236
205
237
# Check Airport Locations
0 commit comments