From b95606ccb8bdb1ffe5dac35ffaceab8b28fbce43 Mon Sep 17 00:00:00 2001 From: CJ Yetman Date: Sat, 9 Sep 2023 12:08:25 +0200 Subject: [PATCH] update GENC scraper --- dictionary/data_genc.csv | 21 +++++++++++++++++++-- dictionary/get_genc.R | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dictionary/data_genc.csv b/dictionary/data_genc.csv index 6b4bf56..72777ad 100644 --- a/dictionary/data_genc.csv +++ b/dictionary/data_genc.csv @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/dictionary/get_genc.R b/dictionary/get_genc.R index 5aa5d78..f88c2bb 100644 --- a/dictionary/get_genc.R +++ b/dictionary/get_genc.R @@ -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))