Skip to content

Instantly share code, notes, and snippets.

@BenHeubl
Last active June 17, 2016 12:23
Show Gist options
  • Save BenHeubl/4f331395a8d40704afeab9a557805727 to your computer and use it in GitHub Desktop.
Save BenHeubl/4f331395a8d40704afeab9a557805727 to your computer and use it in GitHub Desktop.
Vornoi map connected countries
iata Country Status latitude longitude
Afghanistan Afghanistan Get 33.93911 67.709953
Jordan Jordan Get 30.585164 36.238414
Pakistan Pakistan Get 30.375321 69.345116
Kenya Kenya Get -0.023559 37.906193
South_Africa South Africa Get -30.559482 22.937506
Tanzania Tanzania Get -6.369028 34.888822
Nigeria Nigeria Get 9.081999 8.675277
Uganda Uganda Get 1.373333 32.290275
Ethiopia Ethiopia Get 9.145 40.489673
Mozambique Mozambique Get -18.665695 35.529562
Zambia Zambia Get -13.133897 27.849332
Colombia Colombia Get 4.570868 -74.297333
Haiti Haiti Get 18.971187 -72.285215
Senegal Senegal Get 14.497401 -14.452362
Mexico Mexico Get 23.634501 -102.552784
Iraq Iraq Get 33.223191 43.679291
Philippines Philippines Get 12.879721 121.774017
Indonesia Indonesia Get -0.789275 113.921327
Congo_Dem_Rep Congo Get 9.007017 38.769789
Bangladesh Bangladesh Get 23.684994 90.356331
Burkina_Faso Burkina Faso Get 12.238333 -1.561593
Malawi Malawi Get -13.254308 34.301525
South_Sudan South Sudan Get 6.876992 31.306979
Liberia Liberia Get 6.428055 -9.429499
Ukraine Ukraine Get 48.379433 31.16558
Namibia Namibia Get -22.95764 18.49041
Rwanda Rwanda Get -1.940278 29.873888
Ghana Ghana Get 7.946527 -1.023194
Zimbabwe Zimbabwe Get -19.015438 29.154857
Moldova Moldova Get 47.411631 28.369885
Georgia Georgia Get 32.165622 -82.900075
Peru Peru Get -9.189967 -75.015152
Guatemala Guatemala Get 15.783471 -90.230759
Cote_D'Ivoire Cote D'Ivoire Get 7.539989 -5.54708
Lebanon Lebanon Get 33.854721 35.862285
Micronesia_Fed_States Micronesia, Fed. States Get FAILED FAILED
Vietnam Vietnam Get 14.058324 108.277199
India India Get 20.593684 78.96288
Mali Mali Get 17.570692 -3.996166
Egypt Egypt Get 26.820553 30.802498
Honduras Honduras Get 15.199999 -86.241905
Cambodia Cambodia Get 12.565679 104.990963
Nepal Nepal Get 28.394857 84.124008
Kosovo Kosovo Get 42.602636 20.902977
Yemen Yemen Get 15.552727 48.516388
Angola Angola Get -11.202692 17.873887
Botswana Botswana Get -22.328474 24.684866
Madagascar Madagascar Get -18.766947 46.869107
Somalia Somalia Get 5.152149 46.199616
Kyrgyz_Republic Kyrgyz Republic Get 41.20438 74.766098
Syria Syria Get 34.802075 38.996815
Marshall_Islands Marshall Islands Get 6.068302 171.989379
Myanmar Myanmar Get 21.916221 95.955974
Bosnia-Herzegovina Bosnia-Herzegovina Get 43.915886 17.679076
El_Salvador El Salvador Get 13.794185 -88.89653
Swaziland Swaziland Get -26.522503 31.465866
Tajikistan Tajikistan Get 38.861034 71.276093
Guinea Guinea Get 9.945587 -9.696645
Dominican_Republic Dominican Republic Get 18.735693 -70.162651
Benin Benin Get 9.30769 2.315834
Lesotho Lesotho Get -29.609988 28.233608
Cameroon Cameroon Get 7.369722 12.354722
Bolivia Bolivia Get -16.290154 -63.588653
Sri_Lanka Sri Lanka Get 7.873054 80.771797
Armenia Armenia Get 40.069099 45.038189
Sudan Sudan Get 12.862807 30.217636
Kazakhstan Kazakhstan Get 48.019573 66.923684
China China Get 35.86166 104.195397
Serbia Serbia Get 44.016521 21.005859
Thailand Thailand Get 15.870032 100.992541
Morocco Morocco Get 31.791702 -7.09262
Burundi Burundi Get -3.373056 29.918886
Jamaica Jamaica Get 18.109581 -77.297508
Uzbekistan Uzbekistan Get 41.377491 64.585262
Nicaragua Nicaragua Get 12.865416 -85.207229
Macedonia_Fyr Macedonia, Fyr Get FAILED FAILED
Ecuador Ecuador Get -1.831239 -78.183406
Libya Libya Get 26.3351 17.228331
Tunisia Tunisia Get 33.886917 9.537499
Laos Laos Get 19.85627 102.495496
Timor-Leste Timor-Leste Get -8.874217 125.727539
Albania Albania Get 41.153332 20.168331
Brazil Brazil Get -14.235004 -51.92528
Azerbaijan Azerbaijan Get 40.143105 47.576927
Belarus Belarus Get 53.709807 27.953389
Niger Niger Get 17.607789 8.081666
Cuba Cuba Get 21.521757 -77.781167
Paraguay Paraguay Get -23.442503 -58.443832
Palau Palau Get 7.51498 134.58252
Mongolia Mongolia Get 46.862496 103.846656
Guyana Guyana Get 4.860416 -58.93018
Turkmenistan Turkmenistan Get 38.969719 59.556278
Cape_Verde Cape Verde Get 15.120142 -23.605172
Gabon Gabon Get -0.803689 11.609444
Costa_Rica Costa Rica Get 9.748917 -83.753428
Papua_New_Guinea Papua New Guinea Get -6.314993 143.95555
Sierra_Leone Sierra Leone Get 8.460555 -11.779889
Venezuela Venezuela Get 6.42375 -66.58973
Panama Panama Get 8.537981 -80.782127
Djibouti Djibouti Get 11.825138 42.590275
Turkey Turkey Get 38.963745 35.243322
Montenegro Montenegro Get 42.708678 19.37439
Malaysia Malaysia Get 4.210484 101.975766
Togo Togo Get 8.619543 0.824782
Guinea-Bissau Guinea-Bissau Get 11.803749 -15.180413
Chile Chile Get -35.675147 -71.542969
Vanuatu Vanuatu Get -15.376706 166.959158
Fiji Fiji Get -17.713371 178.065032
Gambia Gambia Get 13.443182 -15.310139
Belize Belize Get 17.189877 -88.49765
Mauritania Mauritania Get 21.00789 -10.940835
Congo_Rep Congo, Rep. Get 9.007017 38.769789
Central_African_Rep Central African Rep. Get 9.031519 38.732432
Argentina Argentina Get -38.416097 -63.616672
Iran Iran Get 32.427908 53.688046
Tonga Tonga Get -21.178986 -175.198242
Samoa Samoa Get -13.759029 -172.104629
Sao_Tome_&_Principe Sao Tome & Principe Get 0.18636 6.613081
Solomon_Islands Solomon Islands Get -9.64571 160.156194
Chad Chad Get 15.454166 18.732207
Maldives Maldives Get 1.977247 73.536103
Algeria Algeria Get 28.033886 1.659626
Comoros Comoros Get -11.6455 43.3333
St_Lucia St. Lucia Get 13.909444 -60.978893
Dominica Dominica Get 15.414999 -61.370976
StVincent_&_Grenadines St.Vincent & Grenadines Get 13.252818 -61.197163
Mauritius Mauritius Get -20.348404 57.552152
Tokelau Tokelau Get -9.2002 -171.8484
Seychelles Seychelles Get -4.679574 55.491977
Niue Niue Get -19.054445 -169.867233
Cook_Islands Cook Islands Get -21.236736 -159.777671
Tuvalu Tuvalu Get -7.478421 178.679924
Bhutan Bhutan Get 27.514162 90.433601
Nauru Nauru Get -0.522778 166.931503
Kiribati Kiribati Get -3.370417 -168.734039
Antigua_And_Barbuda Antigua And Barbuda Get 17.060816 -61.796428
Equatorial_Guinea Equatorial Guinea Get 1.650801 10.267895
Eritrea Eritrea Get 15.179384 39.782334
Grenada Grenada Get 12.1165 -61.679
Montserrat Montserrat Get 16.742498 -62.187366
St_Helena St. Helena Get 38.505243 -122.470387
Suriname Suriname Get 3.919305 -56.027783
Uruguay Uruguay Get -32.522779 -55.765835
Wallis_&_Futuna Wallis & Futuna Get -14.2938 -178.1165
Australia Australia Giving -25.274398 133.775136
Austria Austria Giving 47.516231 14.550072
Belgium Belgium Giving 50.503887 4.469936
Canada Canada Giving 56.130366 -106.346771
Czech_Republic Czech Republic Giving 49.817492 15.472962
Denmark Denmark Giving 56.26392 9.501785
Estonia Estonia Giving 58.595272 25.013607
Finland Finland Giving 61.92411 25.748151
France France Giving 46.227638 2.213749
Germany Germany Giving 51.165691 10.451526
Greece Greece Giving 39.074208 21.824312
Hungary Hungary Giving 47.162494 19.503304
Iceland Iceland Giving 64.963051 -19.020835
Ireland Ireland Giving 53.41291 -8.24389
Italy Italy Giving 41.87194 12.56738
Japan Japan Giving 36.204824 138.252924
Kazakhstan Kazakhstan Giving 48.019573 66.923684
Kuwait Kuwait Giving 29.31166 47.481766
South_Korea South Korea Giving 35.907757 127.766922
Lithuania Lithuania Giving 55.169438 23.881275
Luxembourg Luxembourg Giving 49.815273 6.129583
New_Zealand New Zealand Giving -40.900557 174.885971
Netherlands Netherlands Giving 52.132633 5.291266
Norway Norway Giving 60.472024 8.468946
Poland Poland Giving 51.919438 19.145136
Portugal Portugal Giving 39.399872 -8.224454
Romania Romania Giving 45.943161 24.96676
Slovakia Slovakia Giving 48.669026 19.699024
Slovenia Slovenia Giving 46.151241 14.995463
Spain Spain Giving 40.463667 -3.74922
Sweden Sweden Giving 60.128161 18.643501
Switzerland Switzerland Giving 46.818188 8.227512
United_Arab_Emirates United Arab Emirates Giving 23.424076 53.847818
United_Kingdom United Kingdom Giving 55.378051 -3.435973
United_States United States Giving 37.09024 -95.712891
iata Country Status latitude longitude
4 Afghanistan Get 33.93911 67.709953
248 Jordan Get 30.585164 36.238414
8 Pakistan Get 30.375321 69.345116
12 Kenya Get -0.023559 37.906193
16 South Africa Get -30.559482 22.937506
20 Tanzania Get -6.369028 34.888822
24 Nigeria Get 9.081999 8.675277
660 Uganda Get 1.373333 32.290275
10 Ethiopia Get 9.145 40.489673
28 Mozambique Get -18.665695 35.529562
32 Zambia Get -13.133897 27.849332
51 Colombia Get 4.570868 -74.297333
533 Haiti Get 18.971187 -72.285215
36 Senegal Get 14.497401 -14.452362
40 Mexico Get 23.634501 -102.552784
31 Iraq Get 33.223191 43.679291
44 Philippines Get 12.879721 121.774017
48 Indonesia Get -0.789275 113.921327
50 Congo Get 9.007017 38.769789
52 Bangladesh Get 23.684994 90.356331
112 Burkina Faso Get 12.238333 -1.561593
56 Malawi Get -13.254308 34.301525
84 South Sudan Get 6.876992 31.306979
204 Liberia Get 6.428055 -9.429499
60 Ukraine Get 48.379433 31.16558
64 Namibia Get -22.95764 18.49041
68 Rwanda Get -1.940278 29.873888
70 Ghana Get 7.946527 -1.023194
72 Zimbabwe Get -19.015438 29.154857
74 Moldova Get 47.411631 28.369885
76 Georgia Get 32.165622 -82.900075
92 Peru Get -9.189967 -75.015152
86 Guatemala Get 15.783471 -90.230759
96 Cote D'Ivoire Get 7.539989 -5.54708
100 Lebanon Get 33.854721 35.862285
854 Micronesia, Fed. States Get FAILED FAILED
108 Vietnam Get 14.058324 108.277199
116 India Get 20.593684 78.96288
120 Mali Get 17.570692 -3.996166
124 Egypt Get 26.820553 30.802498
132 Honduras Get 15.199999 -86.241905
136 Cambodia Get 12.565679 104.990963
140 Nepal Get 28.394857 84.124008
148 Kosovo Get 42.602636 20.902977
152 Yemen Get 15.552727 48.516388
156 Angola Get -11.202692 17.873887
344 Botswana Get -22.328474 24.684866
446 Madagascar Get -18.766947 46.869107
162 Somalia Get 5.152149 46.199616
166 Kyrgyz Republic Get 41.20438 74.766098
170 Syria Get 34.802075 38.996815
174 Marshall Islands Get 6.068302 171.989379
178 Myanmar Get 21.916221 95.955974
180 Bosnia-Herzegovina Get 43.915886 17.679076
184 El Salvador Get 13.794185 -88.89653
188 Swaziland Get -26.522503 31.465866
384 Tajikistan Get 38.861034 71.276093
191 Guinea Get 9.945587 -9.696645
192 Dominican Republic Get 18.735693 -70.162651
196 Benin Get 9.30769 2.315834
203 Lesotho Get -29.609988 28.233608
208 Cameroon Get 7.369722 12.354722
262 Bolivia Get -16.290154 -63.588653
212 Sri Lanka Get 7.873054 80.771797
214 Armenia Get 40.069099 45.038189
218 Sudan Get 12.862807 30.217636
818 Kazakhstan Get 48.019573 66.923684
222 China Get 35.86166 104.195397
226 Serbia Get 44.016521 21.005859
232 Thailand Get 15.870032 100.992541
233 Morocco Get 31.791702 -7.09262
231 Burundi Get -3.373056 29.918886
238 Jamaica Get 18.109581 -77.297508
234 Uzbekistan Get 41.377491 64.585262
242 Nicaragua Get 12.865416 -85.207229
250 Ecuador Get -1.831239 -78.183406
254 Libya Get 26.3351 17.228331
258 Tunisia Get 33.886917 9.537499
260 Laos Get 19.85627 102.495496
266 Timor-Leste Get -8.874217 125.727539
270 Albania Get 41.153332 20.168331
268 Brazil Get -14.235004 -51.92528
276 Azerbaijan Get 40.143105 47.576927
288 Belarus Get 53.709807 27.953389
292 Niger Get 17.607789 8.081666
300 Cuba Get 21.521757 -77.781167
304 Paraguay Get -23.442503 -58.443832
308 Palau Get 7.51498 134.58252
312 Mongolia Get 46.862496 103.846656
316 Guyana Get 4.860416 -58.93018
320 Turkmenistan Get 38.969719 59.556278
831 Cape Verde Get 15.120142 -23.605172
324 Gabon Get -0.803689 11.609444
624 Costa Rica Get 9.748917 -83.753428
328 Papua New Guinea Get -6.314993 143.95555
332 Sierra Leone Get 8.460555 -11.779889
334 Venezuela Get 6.42375 -66.58973
336 Panama Get 8.537981 -80.782127
340 Djibouti Get 11.825138 42.590275
348 Turkey Get 38.963745 35.243322
352 Montenegro Get 42.708678 19.37439
356 Malaysia Get 4.210484 101.975766
360 Togo Get 8.619543 0.824782
364 Guinea-Bissau Get 11.803749 -15.180413
368 Chile Get -35.675147 -71.542969
372 Vanuatu Get -15.376706 166.959158
833 Fiji Get -17.713371 178.065032
376 Gambia Get 13.443182 -15.310139
380 Belize Get 17.189877 -88.49765
388 Mauritania Get 21.00789 -10.940835
392 Congo, Rep. Get 9.007017 38.769789
832 Central African Rep. Get 9.031519 38.732432
400 Argentina Get -38.416097 -63.616672
398 Iran Get 32.427908 53.688046
404 Tonga Get -21.178986 -175.198242
296 Samoa Get -13.759029 -172.104629
408 Sao Tome & Principe Get 0.18636 6.613081
410 Solomon Islands Get -9.64571 160.156194
414 Chad Get 15.454166 18.732207
417 Maldives Get 1.977247 73.536103
418 Algeria Get 28.033886 1.659626
428 Comoros Get -11.6455 43.3333
422 St. Lucia Get 13.909444 -60.978893
426 Dominica Get 15.414999 -61.370976
430 St.Vincent & Grenadines Get 13.252818 -61.197163
434 Mauritius Get -20.348404 57.552152
438 Tokelau Get -9.2002 -171.8484
440 Seychelles Get -4.679574 55.491977
442 Niue Get -19.054445 -169.867233
807 Cook Islands Get -21.236736 -159.777671
450 Tuvalu Get -7.478421 178.679924
454 Bhutan Get 27.514162 90.433601
458 Nauru Get -0.522778 166.931503
462 Kiribati Get -3.370417 -168.734039
466 Antigua And Barbuda Get 17.060816 -61.796428
470 Equatorial Guinea Get 1.650801 10.267895
584 Eritrea Get 15.179384 39.782334
474 Grenada Get 12.1165 -61.679
478 Montserrat Get 16.742498 -62.187366
480 St. Helena Get 38.505243 -122.470387
175 Suriname Get 3.919305 -56.027783
484 Uruguay Get -32.522779 -55.765835
583 Wallis & Futuna Get -14.2938 -178.1165
498 Australia Giving -25.274398 133.775136
492 Austria Giving 47.516231 14.550072
496 Belgium Giving 50.503887 4.469936
499 Canada Giving 56.130366 -106.346771
500 Czech Republic Giving 49.817492 15.472962
504 Denmark Giving 56.26392 9.501785
508 Estonia Giving 58.595272 25.013607
104 Finland Giving 61.92411 25.748151
516 France Giving 46.227638 2.213749
520 Germany Giving 51.165691 10.451526
524 Greece Giving 39.074208 21.824312
528 Hungary Giving 47.162494 19.503304
530 Iceland Giving 64.963051 -19.020835
540 Ireland Giving 53.41291 -8.24389
554 Italy Giving 41.87194 12.56738
558 Japan Giving 36.204824 138.252924
562 Kazakhstan Giving 48.019573 66.923684
566 Kuwait Giving 29.31166 47.481766
570 South Korea Giving 35.907757 127.766922
574 Lithuania Giving 55.169438 23.881275
580 Luxembourg Giving 49.815273 6.129583
578 New Zealand Giving -40.900557 174.885971
512 Netherlands Giving 52.132633 5.291266
586 Norway Giving 60.472024 8.468946
585 Poland Giving 51.919438 19.145136
275 Portugal Giving 39.399872 -8.224454
591 Romania Giving 45.943161 24.96676
598 Slovakia Giving 48.669026 19.699024
600 Slovenia Giving 46.151241 14.995463
604 Spain Giving 40.463667 -3.74922
608 Sweden Giving 60.128161 18.643501
612 Switzerland Giving 46.818188 8.227512
616 United Arab Emirates Giving 23.424076 53.847818
620 United Kingdom Giving 55.378051 -3.435973
630 United States Giving 37.09024 -95.712891
Country get_give ISO_code
Germany give 276
Denmark give 208
Finland give 246
Norway give 578
Iceland give 352
Sweden give 752
Austria give 40
Ireland give 372
France give 250
Switzerland give 756
Netherlands give 528
Belgium give 56
United Kingdom give 826
Liechtenstein give 438
Spain give 724
Italy give 380
Luxembourg give 442
Czech Republic give 203
Portugal give 620
Slovenia give 705
Hungary give 348
Slovakia give 703
Estonia give 233
Poland give 616
Greece give 300
Malta give 470
Lithuania give 440
Latvia give 428
Cyprus give 196
Romania give 642
Bulgaria give 100
United States of America give 840
Croatia give 191
Japan give 392
New Zealand give 554
Canada give 124
Australia give 36
Chile give 152
Singapore give 702
Korea, Republic of give 410
Argentina give 32
Brazil give 76
San Marino give 674
Monaco give 492
Uruguay give 858
Andorra give 20
Brunei Darussalam give 96
Malaysia give 458
Hong Kong give 344
Taiwan give 158
Paraguay give 600
Bahamas give 44
Israel give 376
Mauritius give 480
Barbados give 52
Macao give 446
Mexico give 484
Costa Rica get 188
Venezuela get 862
Seychelles get 690
Panama get 591
Antigua and Barbuda get 28
Saint Kitts and Nevis get 659
China get 156
Russia get 643
Qatar get 634
Peru get 604
United Arab Emirates get 784
Kuwait get 414
Serbia get 688
Montenegro get 499
Macedonia get 807
Ecuador get 218
El Salvador get 222
Saudi Arabia get 682
Guatemala get 320
Turkey get 792
Bolivia get 68
Honduras get 340
Oman get 512
Bosnia and Herzegovina get 70
Bahrain get 48
Nicaragua get 558
Cape Verde get 132
Moldova get 498
Trinidad and Tobago get 780
Ghana get 288
Albania get 8
Colombia get 170
Belarus get 112
Kazakhstan get 398
Gambia get 270
Benin get 204
Saint Lucia get 662
Ukraine get 804
Senegal get 686
South Africa get 710
Saint Vincent and the Grenadines get 670
Grenada get 308
Sierra Leone get 694
Togo get 768
Dominica get 212
Suriname get 740
Belize get 84
Maldives get 462
C�te d'Ivoire get 384
Guyana get 328
Burkina Faso get 854
Jamaica get 388
Thailand get 764
Nigeria get 566
India get 356
Georgia get 268
Liberia get 430
Mali get 466
Botswana get 72
Guinea get 324
Indonesia get 360
Cuba get 192
Azerbaijan get 31
Tunisia get 788
Niger get 562
Guinea-Bissau get 624
Namibia get 516
Armenia get 51
Uzbekistan get 860
Philippines get 608
Mongolia get 496
Dominican Republic get 214
Bhutan get 64
Tajikistan get 762
Zambia get 894
Jordan get 400
Lesotho get 426
Papua New Guinea get 598
Kyrgyzstan get 417
Vietnam get 704
Morocco get 504
Swaziland get 748
Turkmenistan get 795
Algeria get 12
Gabon get 266
Laos get 418
Timor-Leste get 626
Iran get 364
Kenya get 404
Egypt get 818
Tanzania get 834
Sri Lanka get 144
Libya get 434
Cambodia get 116
Lebanon get 422
Malawi get 454
Sao Tome and Principe get 678
Uganda get 800
Nepal get 524
Zimbabwe get 716
Madagascar get 450
Bangladesh get 50
Mauritania get 478
Equatorial Guinea get 226
Haiti get 332
Palestinian Territory get 275
Congo�(Brazzaville) get 178
Myanmar get 104
Comoros get 174
Angola get 24
Cameroon get 120
Djibouti get 262
Rwanda get 646
Mozambique get 508
Yemen get 887
Iraq get 368
Syria get 760
Pakistan get 586
Ethiopia get 231
Chad get 148
Burundi get 108
Sudan get 736
Eritrea get 232
Central African Republic get 140
Afghanistan get 4
Congo, Democratic Republic of the get 180
Country Year2015 ISO_code
Germany 0 276
Denmark 0 208
Finland 0 246
Norway 0 578
Iceland 0 352
Sweden 0 752
Austria 0 40
Ireland 0 372
France 0 250
Switzerland 0 756
Netherlands 0 528
Belgium 0 56
United Kingdom 0 826
Liechtenstein 0 438
Spain 0 724
Italy 0 380
Luxembourg 0 442
Czech Republic 0 203
Portugal 0 620
Slovenia 0 705
Hungary 0 348
Slovakia 0 703
Estonia 0 233
Poland 0 616
Greece 0 300
Malta 0 470
Lithuania 0 440
Latvia 0 428
Cyprus 0 196
Romania 0 642
Bulgaria 0 100
United States of America 0 840
Croatia 0 191
Japan 0 392
New Zealand 0 554
Canada 0 124
Australia 0 36
Chile 0 152
Singapore 0 702
Korea, Republic of 0 410
Argentina 0 32
Brazil 0 76
San Marino 0 674
Monaco 0 492
Uruguay 0 858
Andorra 0 20
Brunei Darussalam 0 96
Malaysia 0 458
Hong Kong 0 344
Taiwan 0 158
Paraguay 0 600
Bahamas 0 44
Israel 0 376
Mauritius 0 480
Barbados 0 52
Macao 0 446
Mexico 0 484
Costa Rica 1 188
Venezuela 1 862
Seychelles 1 690
Panama 1 591
Antigua and Barbuda 1 28
Saint Kitts and Nevis 1 659
China 1 156
Russia 1 643
Qatar 1 634
Peru 1 604
United Arab Emirates 1 784
Kuwait 1 414
Serbia 1 688
Montenegro 1 499
Macedonia 1 807
Ecuador 1 218
El Salvador 1 222
Saudi Arabia 1 682
Guatemala 1 320
Turkey 1 792
Bolivia 1 68
Honduras 1 340
Oman 1 512
Bosnia and Herzegovina 1 70
Bahrain 1 48
Nicaragua 1 558
Cape Verde 1 132
Moldova 1 498
Trinidad and Tobago 1 780
Ghana 1 288
Albania 1 8
Colombia 1 170
Belarus 1 112
Kazakhstan 1 398
Gambia 1 270
Benin 1 204
Saint Lucia 1 662
Ukraine 1 804
Senegal 1 686
South Africa 1 710
Saint Vincent and the Grenadines 1 670
Grenada 1 308
Sierra Leone 1 694
Togo 1 768
Dominica 1 212
Suriname 1 740
Belize 1 84
Maldives 1 462
C��_te d'Ivoire 1 384
Guyana 1 328
Burkina Faso 1 854
Jamaica 1 388
Thailand 1 764
Nigeria 1 566
India 1 356
Georgia 1 268
Liberia 1 430
Mali 1 466
Botswana 1 72
Guinea 1 324
Indonesia 1 360
Cuba 1 192
Azerbaijan 1 31
Tunisia 1 788
Niger 1 562
Guinea-Bissau 1 624
Namibia 1 516
Armenia 1 51
Uzbekistan 1 860
Philippines 1 608
Mongolia 1 496
Dominican Republic 1 214
Bhutan 1 64
Tajikistan 1 762
Zambia 1 894
Jordan 1 400
Lesotho 1 426
Papua New Guinea 1 598
Kyrgyzstan 1 417
Vietnam 1 704
Morocco 1 504
Swaziland 1 748
Turkmenistan 1 795
Algeria 1 12
Gabon 1 266
Laos 1 418
Timor-Leste 1 626
Iran 1 364
Kenya 1 404
Egypt 1 818
Tanzania 1 834
Sri Lanka 1 144
Libya 1 434
Cambodia 1 116
Lebanon 1 422
Malawi 1 454
Sao Tome and Principe 1 678
Uganda 1 800
Nepal 1 524
Zimbabwe 1 716
Madagascar 1 450
Bangladesh 1 50
Mauritania 1 478
Equatorial Guinea 1 226
Haiti 1 332
Palestinian Territory 1 275
Congo��_(Brazzaville) 1 178
Myanmar 1 104
Comoros 1 174
Angola 1 24
Cameroon 1 120
Djibouti 1 262
Rwanda 1 646
Mozambique 1 508
Yemen 1 887
Iraq 1 368
Syria 1 760
Pakistan 1 586
Ethiopia 1 231
Chad 1 148
Burundi 1 108
Sudan 1 736
Eritrea 1 232
Central African Republic 1 140
Afghanistan 1 4
Congo, Democratic Republic of the 1 180
origin destination count
Germany Afghanistan 472.7867764
Germany Jordan 67.64991342
Germany Pakistan 59.30945635
Germany Kenya 86.88391207
Germany South Africa 131.3848757
Germany Tanzania 45.33938188
Germany Nigeria 47.77141254
origin destination count
4 10 473
248 28 68
8 32 59
12 51 87
16 533 131
20 36 45
24 40 48
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.states {
fill: #ffffff;
}
.country-borders {
fill: none;
stroke: #fed6d6;
stroke-width: 1px;
stroke-linejoin: round;
stroke-linecap: round;
}
.airport-arcs {
display: none;
fill: none;
stroke: #000;
}
.airport-cell {
fill: none;
pointer-events: all;
}
.airport-arcs-incoming {
display: none;
fill: none;
stroke: #c9c9c9;
}
.airport-cell-incoming {
fill: none;
pointer-events: all;
}
.airports circle {
fill: steelblue;
stroke: #fff;
pointer-events: none;
}
.airport:hover .airport-arcs {
display: inline;
}
.airport:hover .airport-arcs-incoming {
display: inline;
}
svg:not(:hover) .airport-cell {
stroke: none;
stroke-opacity: .2;
}
svg:not(:hover) .airport-cell-incoming {
stroke: #000;
stroke-opacity: .2;
}
</style>
<body>
<div id"chart"></div>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/queue.v1.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script>
var margin = {top: 10, right: 20, bottom: 35, left: 45},
width = 595 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var center = [width / 2, height / 2];
var defaultFill = "#e0e0e0";
var numberFormat = d3.format(",.0f"),
numberFormatDetailed = d3.format(",.1f");
numberFormatMoreDetailed = d3.format(",.2f");
// var countryById = d3.map();
// // var commuteById = d3.map();
var countryById = d3.map();
var projection = d3.geo.mercator()
.scale(90)
.translate([width / 2 -20, height / 2 + 40])
.precision(.1);
// var projection = d3.geo.robinson()
// .scale(90)
// .translate([width / 2 -20, height / 2 + 40])
// .precision(.1);
var path = d3.geo.path()
.projection(projection);
// var zoom = d3.behavior.zoom()
// .scaleExtent([1, 8])
// .on("zoom", move);
var legendWidth = width * 0.8,
legendHeight = 10;
// Color scale
// var color = d3.scale.threshold()
// .domain([19, 34, 49, 69]).range(['#b2182b','#ef8a62','#fddbc7','#67a9cf','#2166ac'])
color = d3.scale.category10();
// define the voronoi
var voronoi = d3.geom.voronoi()
.x(function(d) { return d.x; })
.y(function(d) { return d.y; })
.clipExtent([[0, 0], [width, height]])
// define svg
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
queue()
.defer(d3.json, "world-110m.json")
.defer(d3.csv, "airports2.csv")
.defer(d3.csv, "flights2.csv")
.defer(d3.csv, "countrydata2.csv", typeAndSet)
.await(ready);
// load all in
function ready(error, world, airports, flights, country) {
if (error) throw error;
// console.log(country)
var airportById = d3.map(), // d3 map()
positions = [];
airports.forEach(function(d) {
airportById.set(d.iata, d); // set the value for each item
d.outgoing = [];
d.incoming = [];
d.count = [];
});
flights.forEach(function(flight) {
var source = airportById.get(flight.origin),
target = airportById.get(flight.destination),
val = airportById.get(flight.count),
link = {source: source, target: target, val: val};
source.outgoing.push(link);
target.incoming.push(link);
});
airports = airports.filter(function(d) {
if (d.count = Math.max(d.incoming.length, d.outgoing.length)) {
d[0] = +d.longitude;
d[1] = +d.latitude;
var position = projection(d);
d.x = position[0];
d.y = position[1];
return true;
}
});
// console.log()
voronoi(airports)
.forEach(function(d) { d.point.cell = d; });
svg.append("path").classed("countries", true)
.datum(topojson.merge(world, world.objects.countries.geometries))
.attr("class", "states")
.attr("d", path)
svg.append("path")
.datum(topojson.mesh(world, world.objects.countries, function(a, b) { return a !== b; }))
.attr("class", "country-borders")
.attr("d", path);
var airport = svg.append("g")
.attr("class", "airports")
.selectAll("g")
.data(airports.sort(function(a, b) { return b.count - a.count; }))
.enter().append("g")
.attr("class", "airport");
airport.append("path")
.attr("class", "airport-cell")
.attr("d", function(d) { return d.cell.length ? "M" + d.cell.join("L") + "Z" : null; });
airport.append("g")
.attr("class", "airport-arcs")
.selectAll("path")
.data(function(d) { return d.outgoing; })
.enter().append("path")
.attr("d", function(d) { return path({type: "LineString", coordinates: [d.source, d.target]}); })
.attr("stroke", "red")
// .attr("stroke-width", function(d, i) { return parseInt(Math.sqrt(d.count)/10) })
.attr("stroke-dasharray", function (d) {
return "2, 4"
})
// .attr("stroke-dasharray", function (d) {
// return "1, " + d.count/20
// })
// .style("stroke-width", function(d, i) { if (d.count > 500) {return 2} else if (d.count < 500) {return 5} });
.style("stroke-width", 4);
airport.append("g")
.attr("class", "airport-arcs-incoming")
.selectAll("path")
.data(function(d) { return d.incoming; })
.enter().append("path")
.attr("d", function(d) { return path({type: "LineString", coordinates: [d.target, d.source]}); })
.attr("stroke", "blue")
.attr("stroke-dasharray", "1, 1")
// .style("stroke-width", function(d, i) { return parseInt(Math.sqrt(d.val)) })
.style("stroke-width", 4);
airport.append("circle").classed("circlesCountries", true)
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })
.attr("r", 1);
// .attr("r", function(d, i) { return Math.sqrt(d.count); });
updateClasses()
}
function updateClasses() {
svg.selectAll(".states")
.style("fill", function(d) {
return "#F0F8FF"
// console.log(d.id, countryById.get(d.id))
// console.log(countryById.get(d.id) && color(countryById.get(d.id).Year2015))
return countryById.get(d.id) && color(countryById.get(d.id).Year2015);
});
}
function typeAndSet(d) {
d.Year2015 = +d.Year2015;
// d.Year2011 = +d.Year2011;
// d.change = +d.change;
// v.ISO_code = +v.ISO_code;
countryById.set(+d.ISO_code, d);
// console.log(countryById.set(+v.ISO_code, v))
// console.log(d)
return d
}
</script>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment