Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update GENC scraper #345

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions dictionary/data_genc.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
country,genc2c,genc3c,genc3n
ABU MUSA AND TUNB ISLANDS,AA,XAA,935
ABYEI,QN,XQN,936
AFGHANISTAN,AF,AFG,004
AKSAI CHIN AND OTHER AREAS,QO,XQO,937
ALBANIA,AL,ALB,008
ALGERIA,DZ,DZA,012
AMERICAN SAMOA,AS,ASM,016
Expand All @@ -25,11 +28,11 @@ BENIN,BJ,BEN,204
BERMUDA,BM,BMU,060
BHUTAN,BT,BTN,064
BOLIVIA,BO,BOL,068
"BONAIRE, SINT EUSTATIUS, AND SABA",BQ,BES,535
BOSNIA AND HERZEGOVINA,BA,BIH,070
BOTSWANA,BW,BWA,072
BOUVET ISLAND,BV,BVT,074
BRAZIL,BR,BRA,076
BRAZILIAN ISLAND,QP,XQP,938
BRITISH INDIAN OCEAN TERRITORY,IO,IOT,086
BRUNEI,BN,BRN,096
BULGARIA,BG,BGR,100
Expand All @@ -40,6 +43,7 @@ CABO VERDE,CV,CPV,132
CAMBODIA,KH,KHM,116
CAMEROON,CM,CMR,120
CANADA,CA,CAN,124
CARIBBEAN NETHERLANDS,BQ,BES,535
CAYMAN ISLANDS,KY,CYM,136
CENTRAL AFRICAN REPUBLIC,CF,CAF,140
CHAD,TD,TCD,148
Expand All @@ -49,9 +53,12 @@ CHRISTMAS ISLAND,CX,CXR,162
COCOS (KEELING) ISLANDS,CC,CCK,166
COLOMBIA,CO,COL,170
COMOROS,KM,COM,174
CONEJO ISLAND,QQ,XQQ,939
CONGO (BRAZZAVILLE),CG,COG,178
CONGO (KINSHASA),CD,COD,180
CONGO RIVER ISLANDS,QR,XQR,940
COOK ISLANDS,CK,COK,184
CORISCO BAY ISLANDS,QT,XQT,941
COSTA RICA,CR,CRI,188
CÔTE D’IVOIRE,CI,CIV,384
CROATIA,HR,HRV,191
Expand All @@ -63,6 +70,8 @@ DENMARK,DK,DNK,208
DJIBOUTI,DJ,DJI,262
DOMINICA,DM,DMA,212
DOMINICAN REPUBLIC,DO,DOM,214
DOUMEIRA ISLANDS,QV,XQV,942
DRAMANA AND SHAKHATOE,QY,XQY,943
ECUADOR,EC,ECU,218
EGYPT,EG,EGY,818
EL SALVADOR,SV,SLV,222
Expand All @@ -83,6 +92,7 @@ GABON,GA,GAB,266
"GAMBIA, THE",GM,GMB,270
GEORGIA,GE,GEO,268
GERMANY,DE,DEU,276
GEYSER REEF,XF,XXF,944
GHANA,GH,GHA,288
GIBRALTAR,GI,GIB,292
GREECE,GR,GRC,300
Expand All @@ -96,7 +106,9 @@ GUINEA,GN,GIN,324
GUINEA-BISSAU,GW,GNB,624
GUYANA,GY,GUY,328
HAITI,HT,HTI,332
HANS ISLAND,XI,XXI,945
HEARD ISLAND AND MCDONALD ISLANDS,HM,HMD,334
HEIPETHES ISLANDS,XN,XXN,946
HONDURAS,HN,HND,340
HONG KONG,HK,HKG,344
HUNGARY,HU,HUN,348
Expand All @@ -113,9 +125,11 @@ JAMAICA,JM,JAM,388
JAPAN,JP,JPN,392
JERSEY,JE,JEY,832
JORDAN,JO,JOR,400
KALAPANI,XO,XXO,947
KAZAKHSTAN,KZ,KAZ,398
KENYA,KE,KEN,404
KIRIBATI,KI,KIR,296
KOALOU / KOUROU,XX,XXX,948
"KOREA, NORTH",KP,PRK,408
"KOREA, SOUTH",KR,KOR,410
KOSOVO,XK,XKS,901
Expand Down Expand Up @@ -144,6 +158,7 @@ MAURITIUS,MU,MUS,480
MAYOTTE,YT,MYT,175
MEXICO,MX,MEX,484
"MICRONESIA, FEDERATED STATES OF",FM,FSM,583
MINERVA REEFS,XY,XXY,949
MOLDOVA,MD,MDA,498
MONACO,MC,MCO,492
MONGOLIA,MN,MNG,496
Expand Down Expand Up @@ -171,6 +186,7 @@ PALAU,PW,PLW,585
PANAMA,PA,PAN,591
PAPUA NEW GUINEA,PG,PNG,598
PARAGUAY,PY,PRY,600
PARSLEY ISLAND,XZ,XXZ,950
PERU,PE,PER,604
PHILIPPINES,PH,PHL,608
PITCAIRN ISLANDS,PN,PCN,612
Expand All @@ -191,10 +207,12 @@ SAINT VINCENT AND THE GRENADINES,VC,VCT,670
SAMOA,WS,WSM,882
SAN MARINO,SM,SMR,674
SAO TOME AND PRINCIPE,ST,STP,678
SAPODILLA CAYES,ZZ,XZZ,951
SAUDI ARABIA,SA,SAU,682
SENEGAL,SN,SEN,686
SERBIA,RS,SRB,688
SEYCHELLES,SC,SYC,690
SIACHEN,SQ,XSQ,952
SIERRA LEONE,SL,SLE,694
SINGAPORE,SG,SGP,702
SINT MAARTEN,SX,SXM,534
Expand Down Expand Up @@ -242,7 +260,6 @@ VIETNAM,VN,VNM,704
"VIRGIN ISLANDS, U.S.",VI,VIR,850
WALLIS AND FUTUNA,WF,WLF,876
WEST BANK,XW,XWB,934
WESTERN SAHARA,EH,ESH,732
YEMEN,YE,YEM,887
ZAMBIA,ZM,ZMB,894
ZIMBABWE,ZW,ZWE,716
2 changes: 1 addition & 1 deletion dictionary/get_genc.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source(here::here("dictionary/utilities.R"))

# Check https://geonames.nga.mil/gns/html/countrycodes.html quarterly for the latest XLSX url
url <- 'http://geonames.nga.mil/gns/html/docs/GENC_ED3U12_GEC_XWALK.xlsx'
url <- 'https://geonames.nga.mil/geonames/GNSSearch/GNSDocs/xlsdocs/GENC_ED3U17_GEC_XWALK.xlsx'

# Uses DoD Root CA 3, which I don't have in my root certificate store
httr::set_config(config(ssl_verifypeer = 0L))
Expand Down
Loading