[osm/boundaries] check polygons with an ISO3166-2 as well in the country polygon index in case the country polygon is funky
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import pycountry
|
||||
|
||||
|
||||
class Countries(object):
|
||||
AFGHANISTAN = 'af'
|
||||
@@ -252,3 +254,9 @@ class Countries(object):
|
||||
|
||||
FORMER_SOVIET_UNION_COUNTRIES = set([RUSSIA, UKRAINE, BELARUS, KAZAKHSTAN, AZERBAIJAN, KYRGYZSTAN, GEORGIA, UZBEKISTAN, ARMENIA, TAJIKISTAN, MOLDOVA, TURKMENISTAN, LATVIA, LITHUANIA, ESTONIA])
|
||||
CJK_COUNTRIES = set([CHINA, JAPAN, SOUTH_KOREA, TAIWAN, HONG_KONG, MACAO])
|
||||
|
||||
all_country_iso_codes = set([c.alpha2.lower() for c in pycountry.countries])
|
||||
|
||||
@classmethod
|
||||
def is_valid_country_code(cls, alpha2_code):
|
||||
return alpha2_code and alpha2_code.lower() in cls.all_country_iso_codes
|
||||
|
||||
Reference in New Issue
Block a user