3166 icon indicating copy to clipboard operation
3166 copied to clipboard

Missing 16 country codes from data/iso-3166-2.json

Open brianary opened this issue 5 years ago • 7 comments

The data/iso-3166-2.json file is missing entries for AW, AX, BL, BV, CC, CS, CW, CX, EH, HM, MF, NC, NF, PF, SJ, and SX. I could be wrong, but it seems like this list is intended to include all codes from the standard.

See ISO Country Codes Collection or GeoNames or ISO 3166-1 alpha-2 - Wikipedia for details.

brianary avatar Feb 22 '19 22:02 brianary

That's not hard to check, but not so easy to find a fix. It was sure it does contain everything.

theKashey avatar Mar 04 '19 10:03 theKashey

AW does not exist by a mistake - it exists in the original data, but lost in the export http://geolocated.org/AW/

Some locations, as SX, were moved under their "top level" origins - http://geolocated.org/NL/3elo3okh Probably that was a mistake.

I will try to tidy it up, but it's almost a manual work.

theKashey avatar Mar 04 '19 10:03 theKashey

It seems "CW" Curaçao is still missing. Is there any plan to update it?

elvis-certn avatar Oct 29 '21 21:10 elvis-certn

Hi there, I matched against Natural Earth data and got the following missing items.

const ISOCountryListUN = require('iso3166-2-db/countryList/dispute/UN/en')
const ISOCountryList = require('iso3166-2-db/countryList/en')
No result in ISOCountryList for (BV) Bouvet Island
No result in ISOCountryListUN for (BV) Bouvet Island
No result in ISOCountryList for (EH) Western Sahara
No result in ISOCountryListUN for (EH) Western Sahara
No result in ISOCountryList for (CC) Cocos (Keeling) Islands
No result in ISOCountryListUN for (CC) Cocos (Keeling) Islands
No result in ISOCountryList for (CW) Curaçao
No result in ISOCountryListUN for (CW) Curaçao
No result in ISOCountryList for (NC) New Caledonia
No result in ISOCountryListUN for (NC) New Caledonia
No result in ISOCountryList for (MF) Saint Martin (French part)
No result in ISOCountryListUN for (MF) Saint Martin (French part)
No result in ISOCountryList for (PF) French Polynesia
No result in ISOCountryListUN for (PF) French Polynesia
No result in ISOCountryList for (HM) Heard Island and McDonald Islands
No result in ISOCountryListUN for (HM) Heard Island and McDonald Islands
No result in ISOCountryList for (AX) Åland Islands
No result in ISOCountryListUN for (AX) Åland Islands
No result in ISOCountryList for (AW) Aruba
No result in ISOCountryListUN for (AW) Aruba
No result in ISOCountryList for (SJ) Svalbard and Jan Mayen
No result in ISOCountryListUN for (SJ) Svalbard and Jan Mayen
No result in ISOCountryList for (CX) Christmas Island
No result in ISOCountryListUN for (CX) Christmas Island
No result in ISOCountryList for (SX) Sint Maarten (Dutch part)
No result in ISOCountryListUN for (SX) Sint Maarten (Dutch part)
No result in ISOCountryList for (NF) Norfolk Island
No result in ISOCountryListUN for (NF) Norfolk Island
No result in ISOCountryList for (XK) Republic of Kosovo
No result in ISOCountryListUN for (XK) Republic of Kosovo
No result in ISOCountryList for (BL) Saint Barthélemy
No result in ISOCountryListUN for (BL) Saint Barthélemy

I'd be happy to provide you the spatial objects if that helps?

Portur avatar Feb 27 '23 07:02 Portur

No result in ISOCountryListUN for (EH) Western Sahara

It's interesting that EH exists in dispute configuration as 195838 OSM region, deleted 7 years ago. Now EH is represented by https://www.openstreetmap.org/node/2000314677.

Both records are not present in iso3166 database. That is definitely a mistake.

The code XK is being used by the European Commission[28] the IMF, and SWIFT,[29] the CLDR, and other organizations as a temporary country code for Kosovo.[30]

This is why disputes are here - not all codes are expected to present, or present on the top level. For example NF is marked as "not independent", however it's region (https://www.openstreetmap.org/relation/2574988) is also absent in the database 😓

I'd be happy to provide you the spatial objects if that helps?

Ideally, an information record like the ones you can find at https://github.com/esosedi/3166/blob/master/data/iso3166-2.json - that is the main data file, everything else is derived from it. Unfortuantely it does not support any "auto-update".

theKashey avatar Mar 25 '23 05:03 theKashey

@theKashey we have some users asking for the presence of Kosovo (XK). We can hack something to add the code on our end in the meantime, but are there any plans to add Kosovo to this repo? Kosovo appears to now be recognized by most western countries.

I see that XK is already referenced in the Russian exclusion file — I'm not sure if we'd need to add it to other country-specific exclusion configs.

amhunt avatar Jun 15 '23 03:06 amhunt

The first step to resolve the current situation is to update the sources as there is no XK present in the 3166 file, as well as osm and Geonames lookup.

We can hack something to add the code on our end in the meantime

The only way is to add a new record into datasource - https://github.com/esosedi/3166/blob/4967dc5a9cf50c1015592be0ba3050288d60a1a5/data/iso3166-2.json

May be it's a good moment to split one huge source into multiple small configs it will be easier to handle.

theKashey avatar Jun 18 '23 04:06 theKashey