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

ISO 3166-2 country codes #372

Open
ehog90 opened this issue Mar 10, 2020 · 10 comments
Open

ISO 3166-2 country codes #372

ehog90 opened this issue Mar 10, 2020 · 10 comments

Comments

@ehog90
Copy link

@ehog90 ehog90 commented Mar 10, 2020

I think adding ISO 3166-2 country codes to the CSVs (or optionally the region codes) would be useful.

@AymericBou
Copy link

@AymericBou AymericBou commented Mar 10, 2020

I did it for my project, I can share it :
excel format : here
csv format (pipe delimited) : here

@CSSEGISandData
Copy link
Owner

@CSSEGISandData CSSEGISandData commented Mar 10, 2020

Thank you for the suggestion. We have received similar requests and will keep them in mind when building out future capabilities.

@Bost
Copy link

@Bost Bost commented Mar 10, 2020

See Bost/corona_cases#1

(And to put all issues relevant to this subject in one bag: #105)

@Eclipsed830
Copy link

@Eclipsed830 Eclipsed830 commented Mar 11, 2020

The problem with using ISO country codes is they are politicized as being involved with the ISO requires UN Membership. This is why using ISO 3166-2 country codes and naming is considered bad practice and most software developers instead use Unicode CLDR. http://cldr.unicode.org/translation/displaynames/country-names

https://github.com/unicode-cldr/cldr-localenames-full/blob/master/main/en/territories.json

@pmdci
Copy link

@pmdci pmdci commented Mar 20, 2020

It is not true that only UN members can have ISO3166-1 codes. Taiwan (ROC) is not an UN member and it does have an ISO 3166-1 code.

Using custom codes that aren't from the USER-ASSIGNED pool (like DP for Diamond Princess) are likely to cause issues. When adding codes for NON 3166-1 locations (e.g. Diamond Princess), make sure to use USER-ASSIGNED code elements for Alpha-2 and Alpha-3.

See:
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#User-assigned_code_elements
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#User-assigned_code_elements

So you could use something like ZZ as Alpha-2, or anything starting with X. There are 43 possible codes that are reserved for custom usage.

As for numeric does, no number range is currently reserved. I tend to assign ISO3166-1 to SMALLINT in SQL Server (up to 32,767), so you could assign values over 30,000 or perhaps negative values. I strongly suggest AGAINST using negative values though.

@Eclipsed830
Copy link

@Eclipsed830 Eclipsed830 commented Mar 20, 2020

It is not true that only UN members can have ISO3166-1 codes. Taiwan (ROC) is not an UN member and it does have an ISO 3166-1 code

Taiwan's full name using 3166 is "Taiwan, Province of China" tho...

@Bost
Copy link

@Bost Bost commented Mar 20, 2020

So you could use something like ZZ as Alpha-2, or anything starting with X. There are 43 possible codes that are reserved for custom usage.

Please use different codes than ZZ, and XX:

Thanks

@pmdci
Copy link

@pmdci pmdci commented Mar 21, 2020

@Bost
Copy link

@Bost Bost commented Mar 21, 2020

@pmdci we've been working on this since quite a long time https://github.com/ExpDev07/coronavirus-tracker-api/blob/master/app/utils/countrycodes.py have a look or even better create a PR please.

@pmdci
Copy link

@pmdci pmdci commented Mar 25, 2020

I said my peace and you guys seem to have your own way of doing things. Rather than a PR that is likely to just throw fuel at the fire, I just created a mapping table at our end to handle non 3166-1 gibberish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants