diff --git a/server/extension/sql/20_geocode_street.sql b/server/extension/sql/20_geocode_street.sql index 1d0cdb7..02e2a2f 100644 --- a/server/extension/sql/20_geocode_street.sql +++ b/server/extension/sql/20_geocode_street.sql @@ -159,7 +159,7 @@ RETURNS Geometry AS $$ country_iso3 = country_to_iso3(country) coordinates = geocoder.geocode(searchtext=searchtext, city=city, state_province=state_province, - country=country_iso3) + country=country_iso3, search_type='address') if coordinates: quota_service.increment_success_service_use() plan = plpy.prepare("SELECT ST_SetSRID(ST_MakePoint($1, $2), 4326); ", ["double precision", "double precision"]) diff --git a/server/lib/python/cartodb_services/cartodb_services/mapzen/geocoder.py b/server/lib/python/cartodb_services/cartodb_services/mapzen/geocoder.py index 84ae4bd..6765363 100644 --- a/server/lib/python/cartodb_services/cartodb_services/mapzen/geocoder.py +++ b/server/lib/python/cartodb_services/cartodb_services/mapzen/geocoder.py @@ -54,8 +54,9 @@ class MapzenGeocoder: city, state_province) request_params['text'] = search_string - request_params['layers'] = search_type if search_type else 'address' request_params['api_key'] = self._app_key + if search_type: + request_params['layers'] = search_type if country: request_params['boundary.country'] = country return request_params