fire icon indicating copy to clipboard operation
fire copied to clipboard

Migrate country codes to ISO_3166-2 standard

Open artug opened this issue 2 years ago • 6 comments

Some regulators might consider relevant to have the country information disclosed by regions, so it could be interesting to start handling that by using ISO_3166-2 standard https://en.wikipedia.org/wiki/ISO_3166-2

artug avatar Oct 21 '22 13:10 artug

The biggest decision to make is whether to allow ISO-3166-2 in the country field, or have a separate "subdivision" field like:

"country": "AE",
"subdivision": "AE-DU",

Note that subdivision => country, so having both fields would increase the risk of contradictions like

"country": "AE",
"subdivision": "US-NY",

olliemath avatar Oct 21 '22 13:10 olliemath

Yeah I think just expanding the allowed enums list for country_code to include the subdivisions would be best - I have never seen anyone use this kind of granularity though - is it needed for a particular regulation @artug ?

It also seems like it was hard to agree on the right hierarchy under the country code:

GB - GBN => Great Britain GB - UKM => United Kingdom GB - EAW => England & Wales GB - WLS => Wales GB - CYM => also Wales GB - CRD or GB - CRF => Cardiff GB - CMD => Camden

China has 4 municipalities and Estonia has 64!

muratabur avatar Oct 21 '22 14:10 muratabur

BOE treats Dubai, Abu-Dhabi and the rest of the UAE differently. And the Fed treats various US states differently.

Slightly ridiculous to be able to put Camden for the country though :hankey:

olliemath avatar Oct 21 '22 15:10 olliemath

As of 3 March 2022 there are 5,048 codes defined in ISO 3166-2.

I'm not sure 5000 codes is something we want directly in the fire standard though? Should we accept a subset of 3166-2, but not all subdivisions (e.g. just 4: ENG, NIR, SCT, WLS would probably be more than sufficient for the UK)

olliemath avatar Oct 21 '22 15:10 olliemath

:scream:

is there a definitive list somewhere in the regs?

muratabur avatar Oct 21 '22 16:10 muratabur

Mmm, Not sure if you mean documentation from a particular regulator or more in general. In case it was the first instance, I didn't find a definitive list, just find this reference in documentation: image https://www.bankofengland.co.uk/-/media/boe/files/statistics/data-collection/statistical-forms-taxonomy/taxonomy-124-release-note.pdf Located here: https://www.bankofengland.co.uk/statistics/data-collection/beeds

artug avatar Oct 21 '22 17:10 artug

perhaps where we assigned a code before the ISO standard was updated

AG has been ISO for Antigua since 1974, when it was created, so I doubt that ;D

olliemath avatar Oct 22 '22 11:10 olliemath