Fixed geocoding with components

This commit is contained in:
antoniocarlon
2020-01-15 14:48:31 +01:00
parent 620b02c259
commit 9b9f032d30
3 changed files with 88 additions and 27 deletions
@@ -67,7 +67,7 @@ class GeocodioBulkGeocoder(GeocodioGeocoder, StreetPointBulkGeocoder):
return results
def _country_code(self, country):
country_iso3166 = None
country_iso3166 = country
country_iso3 = country_to_iso3(country)
if country_iso3:
country_iso3166 = countries.get(country_iso3).alpha2.lower()
@@ -59,7 +59,8 @@ class GeocodioGeocoder(Traceable):
try:
free_text_components = [searchtext, city, state_province, country]
response = self._geocoder.geocode(';'.join([c for c in free_text_components if c is not None and c.strip()]))
req = '; '.join([c for c in free_text_components if c is not None and c.strip()])
response = self._geocoder.geocode(req)
return self._parse_geocoder_response(response)
except GeocodioDataError as gde: