geotext icon indicating copy to clipboard operation
geotext copied to clipboard

'UK' is in country mentions

Open VanessaVanG opened this issue 6 years ago • 2 comments

"The official ISO country code for the United Kingdom is 'GB'. The code 'UK' is reserved." Both UK and GB are returned in my country mentions for some reason. I'm not even sure what the UK ones are from. (I'm using this on a huge file so there's no way to tell what places it's deeming as UK)

VanessaVanG avatar Aug 13 '18 16:08 VanessaVanG

I had the same issue. Getting 'GB' for United Kingdom and when trying to get the country name with pycountry, it doesn't recognize it, so I have to do the change manually to 'GB' case by case. It would be good to have United Kingdom returning 'GB' instead of 'GB'. List of iso2 codes

Seeing the txt with the list of countries, it seems that it is using the fips code instead of the iso2. Also, there are some other countries that have a different fips than iso2 (fips vs iso list=, so this issue impacts other countries too.

I don't understand how it happens as it seems geotext.py is grabbing the proper columns of the file:

    countries = read_table(
        get_data_path('countryInfo.txt'), usecols=[4, 0], skip=1)

hernandezrivera avatar Sep 12 '18 14:09 hernandezrivera

I ran into this problem too, as well as a few others. Looks like it was coming from nationalities.txt: https://github.com/elyase/geotext/pull/20

albertc1 avatar Feb 02 '19 02:02 albertc1