[countries] take first encountered country code instead of reversing the components (for cases like Puerto Rico, Hong Kong, etc.)
This commit is contained in:
@@ -479,7 +479,7 @@ class OSMCountryReverseGeocoder(OSMReverseGeocoder):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def country_and_languages_from_components(cls, osm_components):
|
def country_and_languages_from_components(cls, osm_components):
|
||||||
country = None
|
country = None
|
||||||
for c in reversed(osm_components):
|
for c in osm_components:
|
||||||
country = c.get('ISO3166-1:alpha2')
|
country = c.get('ISO3166-1:alpha2')
|
||||||
if country:
|
if country:
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user