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

Collection of ISO codes for countries #46

Closed
siaw23-retired opened this issue Mar 25, 2020 · 27 comments
Closed

Collection of ISO codes for countries #46

siaw23-retired opened this issue Mar 25, 2020 · 27 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@siaw23-retired
Copy link
Collaborator

siaw23-retired commented Mar 25, 2020

In response to #40, we need help collecting ISO 3166-1 alpha-2 country codes for the following groupings:

  1. EU (European Union)
  2. Africa
  3. Asia
  4. South America
  5. Europe

The codes should be an array of strings. With this, we can aggregate information on a continental level.

@siaw23-retired siaw23-retired added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 25, 2020
@lorrden
Copy link

lorrden commented Mar 25, 2020

EU = ["se", "fi", "dk", "ie", "ee", "lv", "lt", "nl", "be", "lu", "de", "pl", "cz", "sk", "at", "hu", "ro", "bg", "si", "hr", "it", "fr", "es", "pt", "mt", "gr", "cy"]

(Total count should be 27 these days).

@lorrden
Copy link

lorrden commented Mar 25, 2020

europe = eu + ["gb", "is", "no", "ch", "mc", "ad", "sm", "va", "ba", "rs", "me", "mk", "al", "by", "ua", "ru", "md"]

The following may be included depending on definition: "tr", "ge", "az", "am"

"gb" or "uk" are both reserved, but GB is the official one.

Edit: Forgot Moldova
Edit 2: removed Faroe Islands

@lorrden
Copy link

lorrden commented Mar 25, 2020

Europe also has a bunch of dependent territories with their own 2 letter code (e.g. AX is the Åland Islands in Finland), I assume these can be ignored?

Maybe they should be listed for completeness sake: "fo", "ax", "gl", "im", "gg", "je", "gi", and "sj". Where GL is debatable whether it is in Europe.

Edit added "fo"

@siaw23-retired
Copy link
Collaborator Author

There are 44 countries in Europe right? How about we add the 17 (out of the EU) + the EU and call it EUROPE aggregation? Is that what you're saying? If so then this list of ISO codes is not up to 17

"ax", "gl", "im", "gg", "je", "gi", and "sj"

Am I making any sense?

Adding Åland Islands in Finland to European Aggregation will make sense I think.

@siaw23-retired
Copy link
Collaborator Author

Oooo I missed your preview post on this one

europe = eu + ["gb", "is", "fo", "no", "ch", "mc", "ad", "sm", "va", "ba", "rs", "me", "mk", "al", "by", "ua", "ru", "md"]

But that's 18 + 27 (EU) making 45 countries. There's an extra country. Will that be the Åland Islands? Sorry I don't know the codes and haven't checked them.

@lorrden
Copy link

lorrden commented Mar 25, 2020

I accidentally listed the Faroe Islands as an independent state. Think the tally should be right now.

@siaw23-retired
Copy link
Collaborator Author

Perfect! Thanks. I'll get this implemented tomorrow :)

@lorrden
Copy link

lorrden commented Mar 28, 2020

south_america = ["AR" "BO", "BV", "BR", "CL", "CO", "EC", "FK", "GF", "GY", "PY", "PE", "GS", "SR", "UY", "VE"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

middle_america = ["BZ", "CR", "SV", "GT", "HN", "NI", "PA"]

@siaw23-retired
Copy link
Collaborator Author

Oh great! Thanks. Will get these done by Monday :)

@lorrden
Copy link

lorrden commented Mar 28, 2020

carribian_islands = [ "BS", "TC", "KY", "CU", "HT", "DO", "JM", "PR", "VI", "VG", "AI", "AG", "MF", "SX", "BQ", "BL", "KN", "MS", "GP", "DM", "MQ", "LC", "VC", "GD", "BB", "TT", "AW", "CW"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

middle_east_excluding_cyprus = ["BH", "EG", "IR", "IQ", "IL", "JO", "KW", "LB", "OM", "PS", "QA", "SA", "SY", "TR", "AE", "YE"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

africa = ["DZ", "AO", "BJ", "BW", "BF", "BI", "CM", "CV", "CF", "TD", "KM", "CD", "CG", "CI", "DJ", "EG", "GQ", "ER", "SZ", "ET", "GA", "GM", "GH", "GN", "GW", "KE", "LS", "LR", "LY", "MG", "MW", "ML", "MR", "MU", "MA", "MZ", "NA", "NE", "NG", "RW", "ST", "SN", "SC", "SL", "SO", "ZA", "SS", "SD", "TZ", "TG", "TN", "UG", "ZM", "ZW", "EH"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

central_asia = ["KZ", "KG", "TJ", "TM", "UZ"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

east_asia = ["CN", "HK", "MO", "MN", "KP", "KR", "JP", "TW"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

south_asia = ["BT", "BD", "AF", "IN", "LK", "NP", "PK"]

@lorrden
Copy link

lorrden commented Mar 28, 2020

south_east_asia = ["KH", "LA", "MM", "MY", "TH", "VN", "PH", "ID", "SG", "BN", "CX", "TL", "CC"]

@siaw23-retired
Copy link
Collaborator Author

✅ Africa done.

@siaw23-retired
Copy link
Collaborator Author

Can you please edit my original post and add the new groupings? To make it easier for me to follow what's implemented and what's not? @lorrden

@siaw23-retired
Copy link
Collaborator Author

✅ Europe done.

@siaw23-retired
Copy link
Collaborator Author

✅ South America cone.

@siaw23-retired
Copy link
Collaborator Author

I'd like to combine all Asian countries, there are 49 countries in Asia, the Asian arrays above give 33 countries... is there a chance you can help me get the rest? @lorrden

@lorrden
Copy link

lorrden commented Mar 29, 2020

Last part of Asia, excluding Egypt (sinai), and Cyprus (cy); also including and the caucasus states (am, az, ge).

Russia was listed above as belonging to Europe, most of the population would be there anyway, same with Cyprus, which inherited Europe from being in the EU.

There are probably some Indian Ocean territories that have been missed in the lists.

I broke it down in smaller regions West Asia, etc since those are more well defined that Asia as a whole.

I think we have a tally larger than 49, I haven't looked at why, but there are some ISO codes assigned to non-generally recognised states which could explain some over count.

In any case:
west_asia = ["TR", "BH", "KW", "OM", "QA", "SA", "AE", "YE", "AM", "AZ", "GE", "IQ", "IL", "JO", "LB", "PS", "SY", "IR"]

@lorrden
Copy link

lorrden commented Mar 29, 2020

oceania = ["AU", "FM", "PG", "GU", "MH", "MP", "KI", "NR", "PW", "FJ", "SB", "VU", "UM", "NC", "AS", "CK", "PF", "NZ", "NU", "NF", "PN", "WS", "TK", "TO", "TV", "WF"]

@lorrden
Copy link

lorrden commented Mar 29, 2020

Can you please edit my original post and add the new groupings? To make it easier for me to follow what's implemented and what's not? @lorrden

I don't have permissions to do that.

@siaw23-retired
Copy link
Collaborator Author

OK no worries. I have gone ahead to implement a command to aggregate information on Asia. There might be 2 ISO codes that we'll need to remove. Can you please check and see which two we can removed to get 49 countries for Asia? The ISOs for Asia are here https://github.com/siaw23/kovid/blob/master/lib/kovid/request.rb#L16

Screenshot 2020-03-29 at 13 48 42

@siaw23-retired
Copy link
Collaborator Author

I'm considering this done. Thanks a lot for the help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants