Public
Edited
Apr 2, 2024
Importers
Insert cell
Insert cell
Insert cell
function fixCode(code) {
if (code === "PSX") {
return "PSE";
} else if (code === "ALD") {
return "ALA";
}
return code;
}
Insert cell
nameToCode = ({
Afghanistan: "AFG",
"Åland Islands": "ALA",
"Aland Islands": "ALA",
Åland: "ALA",
Aland: "ALA",
Albania: "ALB",
Algeria: "DZA",
"American Samoa": "ASM",
Andorra: "AND",
Angola: "AGO",
Anguilla: "AIA",
Antarctica: "ATA",
"Antigua and Barbuda": "ATG",
"Antigua and Barb.": "ATG",
Argentina: "ARG",
Armenia: "ARM",
Aruba: "ABW",
Australia: "AUS",
Austria: "AUT",
Azerbaijan: "AZE",
Bahamas: "BHS",
"The Bahamas": "BHS",
Bahrain: "BHR",
Bangladesh: "BGD",
Barbados: "BRB",
Belarus: "BLR",
Belgium: "BEL",
Belize: "BLZ",
Benin: "BEN",
Bermuda: "BMU",
Bhutan: "BTN",
"Bolivia, Plurinational State of": "BOL",
"Bolivia (Plurinational State of)": "BOL",
Bolivia: "BOL",
"Bonaire, Sint Eustatius and Saba": "BES",
"Bosnia and Herzegovina": "BIH",
"Bosnia and Herz.": "BIH",
Botswana: "BWA",
"Bouvet Island": "BVT",
Brazil: "BRA",
"British Indian Ocean Territory": "IOT",
"Br. Indian Ocean Ter.": "IOT",
"Brunei Darussalam": "BRN",
Brunei: "BRN",
Bulgaria: "BGR",
"Burkina Faso": "BFA",
Burundi: "BDI",
"Cabo Verde": "CPV",
"Cape Verde": "CPV",
Cambodia: "KHM",
Cameroon: "CMR",
Canada: "CAN",
"Cayman Islands": "CYM",
"Cayman Is.": "CYM",
"Central African Republic": "CAF",
"Central African Rep.": "CAF",
Chad: "TCD",
Chile: "CHL",
China: "CHN",
"People's Republic of China": "CHN",
"Christmas Island": "CXR",
"Cocos (Keeling) Islands": "CCK",
Colombia: "COL",
Comoros: "COM",
Congo: "COG",
"Republic of Congo": "COG",
"Congo (Brazzaville)": "COG",
"Congo, Democratic Republic of the": "COD",
"Democratic Republic of the Congo": "COD",
"Democratic Republic of Congo": "COD",
"Dem. Rep. Congo": "COD",
"Congo (Kinshasa)": "COD",
"Cook Islands": "COK",
"Cook Is.": "COK",
"Costa Rica": "CRI",
"Côte d'Ivoire": "CIV",
"Cote d'Ivoire": "CIV",
"Ivory Coast": "CIV",
Croatia: "HRV",
Cuba: "CUB",
Curaçao: "CUW",
Curacao: "CUW",
Cyprus: "CYP",
Czechia: "CZE",
"Czech Republic": "CZE",
"Czech Rep.": "CZE",
Denmark: "DNK",
Djibouti: "DJI",
Dominica: "DMA",
"Dominican Republic": "DOM",
"Dominican Rep.": "DOM",
Ecuador: "ECU",
Egypt: "EGY",
"El Salvador": "SLV",
"Equatorial Guinea": "GNQ",
"Eq. Guinea": "GNQ",
Eritrea: "ERI",
Estonia: "EST",
Eswatini: "SWZ",
eSwatini: "SWZ",
Swaziland: "SWZ",
Ethiopia: "ETH",
"Falkland Islands (Malvinas)": "FLK",
"Falkland Islands": "FLK",
"Falkland Is.": "FLK",
"Faroe Islands": "FRO",
"Faeroe Is.": "FRO",
Fiji: "FJI",
Finland: "FIN",
France: "FRA",
"French Guiana": "GUF",
"French Polynesia": "PYF",
"Fr. Polynesia": "PYF",
"French Southern Territories": "ATF",
"French Southern and Antarctic Lands": "ATF",
"Fr. S. Antarctic Lands": "ATF",
Gabon: "GAB",
Gambia: "GMB",
"The Gambia": "GMB",
Georgia: "GEO",
Germany: "DEU",
Ghana: "GHA",
Gibraltar: "GIB",
Greece: "GRC",
Greenland: "GRL",
Grenada: "GRD",
Guadeloupe: "GLP",
Guam: "GUM",
Guatemala: "GTM",
Guernsey: "GGY",
Guinea: "GIN",
"Guinea-Bissau": "GNB",
Guyana: "GUY",
Haiti: "HTI",
"Heard Island and McDonald Islands": "HMD",
"Heard I. and McDonald Is.": "HMD",
"Holy See": "VAT",
Vatican: "VAT",
"The Vatican": "VAT",
"Vatican City": "VAT",
Honduras: "HND",
"Hong Kong": "HKG",
"Hong Kong S.A.R. of China": "HKG",
Hungary: "HUN",
Iceland: "ISL",
India: "IND",
Indonesia: "IDN",
"Iran, Islamic Republic of": "IRN",
"Iran (Islamic Republic of)": "IRN",
Iran: "IRN",
Iraq: "IRQ",
Ireland: "IRL",
"Isle of Man": "IMN",
Israel: "ISR",
Italy: "ITA",
Jamaica: "JAM",
Japan: "JPN",
Jersey: "JEY",
Jordan: "JOR",
Kazakhstan: "KAZ",
Kenya: "KEN",
Kiribati: "KIR",
"Korea, Democratic People's Republic of": "PRK",
"North Korea": "PRK",
"Korea, Republic of": "KOR",
"Republic of Korea": "KOR",
"South Korea": "KOR",
Kosovo: "XKX",
Kuwait: "KWT",
Kyrgyzstan: "KGZ",
"Lao People's Democratic Republic": "LAO",
Laos: "LAO",
Latvia: "LVA",
Lebanon: "LBN",
Lesotho: "LSO",
Liberia: "LBR",
Libya: "LBY",
Liechtenstein: "LIE",
Lithuania: "LTU",
Luxembourg: "LUX",
Macao: "MAC",
Madagascar: "MDG",
Malawi: "MWI",
Malaysia: "MYS",
Maldives: "MDV",
Mali: "MLI",
Malta: "MLT",
"Marshall Islands": "MHL",
"Marshall Is.": "MHL",
Martinique: "MTQ",
Mauritania: "MRT",
Mauritius: "MUS",
Mayotte: "MYT",
Mexico: "MEX",
"Micronesia, Federated States of": "FSM",
"Federated States of Micronesia": "FSM",
Micronesia: "FSM",
"Moldova, Republic of": "MDA",
"Republic of Moldova": "MDA",
Moldova: "MDA",
Monaco: "MCO",
"Principality of Monaco": "MCO",
"Monaco, Principality of": "MCO",
Mongolia: "MNG",
Montenegro: "MNE",
Montserrat: "MSR",
Morocco: "MAR",
Mozambique: "MOZ",
Myanmar: "MMR",
Namibia: "NAM",
Nauru: "NRU",
"Republic of Nauru": "NRU",
Nepal: "NPL",
"Netherlands, Kingdom of the": "NLD",
"Netherlands (Kingdom of the)": "NLD",
Netherlands: "NLD",
"New Caledonia": "NCL",
"New Zealand": "NZL",
Nicaragua: "NIC",
Niger: "NER",
Nigeria: "NGA",
Niue: "NIU",
"Republic of Niue": "NIU",
"Norfolk Island": "NFK",
"North Macedonia": "MKD",
Macedonia: "MKD",
"Northern Mariana Islands": "MNP",
"N. Mariana Is.": "MNP",
"Northern Cyprus": "CYN",
"N. Cyprus": "CYN",
Norway: "NOR",
Oman: "OMN",
Pakistan: "PAK",
Palau: "PLW",
"Republic of Palau": "PLW",
"Palestine, State of": "PSE",
"State of Palestine": "PSE",
Palestine: "PSE",
Panama: "PAN",
"Papua New Guinea": "PNG",
Paraguay: "PRY",
Peru: "PER",
Philippines: "PHL",
Pitcairn: "PCN",
"Pitcairn Is.": "PCN",
Poland: "POL",
Portugal: "PRT",
"Puerto Rico": "PRI",
Qatar: "QAT",
Réunion: "REU",
Romania: "ROU",
"Russian Federation": "RUS",
Russia: "RUS",
Rwanda: "RWA",
"Saint Barthélemy": "BLM",
"St-Barthélemy": "BLM",
"Saint Helena, Ascension and Tristan da Cunha": "SHN",
"Saint Helena": "SHN",
"Saint Kitts and Nevis": "KNA",
"St. Kitts and Nevis": "KNA",
"Saint Lucia": "LCA",
"Saint Martin (French part)": "MAF",
"Saint Martin": "MAF",
"St-Martin": "MAF",
"Saint Pierre and Miquelon": "SPM",
"St. Pierre and Miquelon": "SPM",
"Saint Vincent and the Grenadines": "VCT",
"St. Vin. and Gren.": "VCT",
Samoa: "WSM",
"San Marino": "SMR",
"Republic of San Marino": "SMR",
"San Marino, Republic of": "SMR",
"São Tomé and Principe": "STP",
"Sao Tome and Principe": "STP",
"Saudi Arabia": "SAU",
Senegal: "SEN",
Serbia: "SRB",
Seychelles: "SYC",
"Sierra Leone": "SLE",
Singapore: "SGP",
"Sint Maarten (Dutch part)": "SXM",
"Sint Maarten": "SXM",
Slovakia: "SVK",
Slovenia: "SVN",
"Solomon Islands": "SLB",
"Solomon Is.": "SLB",
Somalia: "SOM",
Somaliland: "SOL",
"Somaliland region": "SOL",
"South Africa": "ZAF",
"South Georgia and the South Sandwich Islands": "SGS",
"S. Geo. and the Is.": "SGS",
"South Sudan": "SSD",
"S. Sudan": "SSD",
Spain: "ESP",
"Sri Lanka": "LKA",
Sudan: "SDN",
Suriname: "SUR",
"Svalbard and Jan Mayen": "SJM",
Sweden: "SWE",
Switzerland: "CHE",
"Syrian Arab Republic": "SYR",
Syria: "SYR",
"Taiwan, Province of China": "TWN",
Taiwan: "TWN",
"Taiwan Province of China": "TWN",
Tajikistan: "TJK",
"Tanzania, United Republic of": "TZA",
"United Republic of Tanzania": "TZA",
Tanzania: "TZA",
Thailand: "THA",
"Timor-Leste": "TLS",
Togo: "TGO",
Tokelau: "TKL",
Tonga: "TON",
"Trinidad and Tobago": "TTO",
Tunisia: "TUN",
Türkiye: "TUR",
Turkiye: "TUR",
Turkey: "TUR",
Turkmenistan: "TKM",
"Turks and Caicos Islands": "TCA",
"Turks and Caicos Is.": "TCA",
Tuvalu: "TUV",
Uganda: "UGA",
Ukraine: "UKR",
"United Arab Emirates": "ARE",
"United Kingdom of Great Britain and Northern Ireland": "GBR",
"United Kingdom": "GBR",
"United States of America": "USA",
"United States": "USA",
"United States Minor Outlying Islands": "UMI",
Uruguay: "URY",
Uzbekistan: "UZB",
Vanuatu: "VUT",
"Venezuela, Bolivarian Republic of": "VEN",
Venezuela: "VEN",
"Viet Nam": "VNM",
Vietnam: "VNM",
"Virgin Islands (British)": "VGB",
"British Virgin Is.": "VGB",
"Virgin Islands, British": "VGB",
"Virgin Islands (U.S.)": "VIR",
"U.S. Virgin Is.": "VIR",
"Virgin Islands, U.S.": "VIR",
"Wallis and Futuna": "WLF",
"Wallis and Futuna Is.": "WLF",
"Western Sahara": "ESH",
"W. Sahara": "ESH",
Yemen: "YEM",
Zambia: "ZMB",
Zimbabwe: "ZWE"
})
Insert cell
Insert cell
codeToName = ({
AFG: "Afghanistan",
ALA: "Åland Islands",
ALB: "Albania",
DZA: "Algeria",
ASM: "American Samoa",
AND: "Andorra",
AGO: "Angola",
AIA: "Anguilla",
ATA: "Antarctica",
ATG: "Antigua and Barbuda",
ARG: "Argentina",
ARM: "Armenia",
ABW: "Aruba",
AUS: "Australia",
AUT: "Austria",
AZE: "Azerbaijan",
BHS: "Bahamas",
BHR: "Bahrain",
BGD: "Bangladesh",
BRB: "Barbados",
BLR: "Belarus",
BEL: "Belgium",
BLZ: "Belize",
BEN: "Benin",
BMU: "Bermuda",
BTN: "Bhutan",
BOL: "Bolivia",
BES: "Bonaire, Sint Eustatius and Saba",
BIH: "Bosnia and Herzegovina",
BWA: "Botswana",
BVT: "Bouvet Island",
BRA: "Brazil",
IOT: "British Indian Ocean Territory",
BRN: "Brunei Darussalam",
BGR: "Bulgaria",
BFA: "Burkina Faso",
BDI: "Burundi",
CPV: "Cabo Verde",
KHM: "Cambodia",
CMR: "Cameroon",
CAN: "Canada",
CYM: "Cayman Islands",
CAF: "Central African Republic",
TCD: "Chad",
CHL: "Chile",
CHN: "China",
CXR: "Christmas Island",
CCK: "Cocos (Keeling) Islands",
COL: "Colombia",
COM: "Comoros",
COG: "Republic of Congo",
COD: "Democratic Republic of the Congo",
COK: "Cook Islands",
CRI: "Costa Rica",
CIV: "Côte d'Ivoire",
HRV: "Croatia",
CUB: "Cuba",
CUW: "Curaçao",
CYP: "Cyprus",
CZE: "Czechia",
DNK: "Denmark",
DJI: "Djibouti",
DMA: "Dominica",
DOM: "Dominican Republic",
ECU: "Ecuador",
EGY: "Egypt",
SLV: "El Salvador",
GNQ: "Equatorial Guinea",
ERI: "Eritrea",
EST: "Estonia",
SWZ: "Eswatini",
ETH: "Ethiopia",
FLK: "Falkland Islands (Malvinas)",
FRO: "Faroe Islands",
FJI: "Fiji",
FIN: "Finland",
FRA: "France",
GUF: "French Guiana",
PYF: "French Polynesia",
ATF: "French Southern Territories",
GAB: "Gabon",
GMB: "Gambia",
GEO: "Georgia",
DEU: "Germany",
GHA: "Ghana",
GIB: "Gibraltar",
GRC: "Greece",
GRL: "Greenland",
GRD: "Grenada",
GLP: "Guadeloupe",
GUM: "Guam",
GTM: "Guatemala",
GGY: "Guernsey",
GIN: "Guinea",
GNB: "Guinea-Bissau",
GUY: "Guyana",
HTI: "Haiti",
HMD: "Heard Island and McDonald Islands",
VAT: "Holy See",
HND: "Honduras",
HKG: "Hong Kong",
HUN: "Hungary",
ISL: "Iceland",
IND: "India",
IDN: "Indonesia",
IRN: "Iran",
IRQ: "Iraq",
IRL: "Ireland",
IMN: "Isle of Man",
ISR: "Israel",
ITA: "Italy",
JAM: "Jamaica",
JPN: "Japan",
JEY: "Jersey",
JOR: "Jordan",
KAZ: "Kazakhstan",
KEN: "Kenya",
KIR: "Kiribati",
PRK: "North Korea",
KOR: "South Korea",
XKX: "Kosovo",
KWT: "Kuwait",
KGZ: "Kyrgyzstan",
LAO: "Laos",
LVA: "Latvia",
LBN: "Lebanon",
LSO: "Lesotho",
LBR: "Liberia",
LBY: "Libya",
LIE: "Liechtenstein",
LTU: "Lithuania",
LUX: "Luxembourg",
MAC: "Macao",
MDG: "Madagascar",
MWI: "Malawi",
MYS: "Malaysia",
MDV: "Maldives",
MLI: "Mali",
MLT: "Malta",
MHL: "Marshall Islands",
MTQ: "Martinique",
MRT: "Mauritania",
MUS: "Mauritius",
MYT: "Mayotte",
MEX: "Mexico",
FSM: "Micronesia",
MDA: "Moldova",
MCO: "Monaco",
MNG: "Mongolia",
MNE: "Montenegro",
MSR: "Montserrat",
MAR: "Morocco",
MOZ: "Mozambique",
MMR: "Myanmar",
NAM: "Namibia",
NRU: "Nauru",
NPL: "Nepal",
NLD: "Netherlands",
NCL: "New Caledonia",
NZL: "New Zealand",
NIC: "Nicaragua",
NER: "Niger",
NGA: "Nigeria",
NIU: "Niue",
NFK: "Norfolk Island",
MKD: "North Macedonia",
CYN: "Northern Cyprus",
MNP: "Northern Mariana Islands",
NOR: "Norway",
OMN: "Oman",
PAK: "Pakistan",
PLW: "Palau",
PSE: "Palestine",
PAN: "Panama",
PNG: "Papua New Guinea",
PRY: "Paraguay",
PER: "Peru",
PHL: "Philippines",
PCN: "Pitcairn",
POL: "Poland",
PRT: "Portugal",
PRI: "Puerto Rico",
QAT: "Qatar",
REU: "Réunion",
ROU: "Romania",
RUS: "Russia",
RWA: "Rwanda",
BLM: "Saint Barthélemy",
SHN: "Saint Helena, Ascension and Tristan da Cunha",
KNA: "Saint Kitts and Nevis",
LCA: "Saint Lucia",
MAF: "Saint Martin (French part)",
SPM: "Saint Pierre and Miquelon",
VCT: "Saint Vincent and the Grenadines",
WSM: "Samoa",
SMR: "San Marino",
STP: "Sao Tome and Principe",
SAU: "Saudi Arabia",
SEN: "Senegal",
SRB: "Serbia",
SYC: "Seychelles",
SLE: "Sierra Leone",
SGP: "Singapore",
SXM: "Sint Maarten (Dutch part)",
SVK: "Slovakia",
SVN: "Slovenia",
SLB: "Solomon Islands",
SOM: "Somalia",
SOL: "Somaliland",
ZAF: "South Africa",
SGS: "South Georgia and the South Sandwich Islands",
SSD: "South Sudan",
ESP: "Spain",
LKA: "Sri Lanka",
SDN: "Sudan",
SUR: "Suriname",
SJM: "Svalbard and Jan Mayen",
SWE: "Sweden",
CHE: "Switzerland",
SYR: "Syria",
TWN: "Taiwan",
TJK: "Tajikistan",
TZA: "Tanzania",
THA: "Thailand",
TLS: "Timor-Leste",
TGO: "Togo",
TKL: "Tokelau",
TON: "Tonga",
TTO: "Trinidad and Tobago",
TUN: "Tunisia",
TUR: "Türkiye",
TKM: "Turkmenistan",
TCA: "Turks and Caicos Islands",
TUV: "Tuvalu",
UGA: "Uganda",
UKR: "Ukraine",
ARE: "United Arab Emirates",
GBR: "United Kingdom",
USA: "United States",
UMI: "United States Minor Outlying Islands",
URY: "Uruguay",
UZB: "Uzbekistan",
VUT: "Vanuatu",
VEN: "Venezuela",
VNM: "Viet Nam",
VGB: "Virgin Islands (British)",
VIR: "Virgin Islands (U.S.)",
WLF: "Wallis and Futuna",
ESH: "Western Sahara",
YEM: "Yemen",
ZMB: "Zambia",
ZWE: "Zimbabwe"
})
Insert cell
Insert cell
import { countries50m as countries } from "@visionscarto/geo"
Insert cell
{
const vcNames = new Set(countries.features.map((d) => d.properties.name));
const ourNames = new Set(Object.keys(nameToCode));
return [...vcNames].filter((name) => !ourNames.has(name));
}
Insert cell
{
const vcCodes = new Set(countries.features.map((d) => d.properties.a3));
const ourCodes = new Set(Object.keys(codeToName));
return [...vcCodes].filter((name) => !ourCodes.has(name));
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more