Add search type filter for Mapzen geocoder
This commit is contained in:
@@ -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"])
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user