[languages] using country_and_languages method in OSM, neighborhoods and OpenAddresses
This commit is contained in:
@@ -465,7 +465,7 @@ class OSMCountryReverseGeocoder(OSMReverseGeocoder):
|
||||
polygon_reader = OSMCountryPolygonReader
|
||||
|
||||
@classmethod
|
||||
def country_and_languages(cls, osm_components):
|
||||
def country_and_languages_from_components(cls, osm_components):
|
||||
country = None
|
||||
for c in reversed(osm_components):
|
||||
country = c.get('ISO3166-1:alpha2')
|
||||
@@ -501,6 +501,10 @@ class OSMCountryReverseGeocoder(OSMReverseGeocoder):
|
||||
|
||||
return country, default_languages
|
||||
|
||||
def country_and_languages(self, lat, lon):
|
||||
osm_components = self.point_in_poly(lat, lon, return_all=True)
|
||||
return self.country_and_languages_from_components(osm_components)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Handle argument parsing here
|
||||
|
||||
Reference in New Issue
Block a user