here_location_services.geocoding_search_api module
This module contains classes for accessing HERE Geocoding & Search API.
- class here_location_services.geocoding_search_api.GeocodingSearchApi(api_key=None, auth=None, proxies=None, country='row')[source]
Bases:
here_location_services.apis.Api
A class for accessing HERE Geocoding & search APIs.
- Parameters
api_key (Optional[str]) –
auth (Optional[here_location_services.platform.auth.Auth]) –
proxies (Optional[dict]) –
country (str) –
- __init__(api_key=None, auth=None, proxies=None, country='row')[source]
- Parameters
api_key (Optional[str]) –
auth (Optional[here_location_services.platform.auth.Auth]) –
proxies (Optional[dict]) –
country (str) –
- get_geocoding(query, limit=20, lang='en-US')[source]
Get point for given free-form search query.
See further information here: Geocode
- Parameters
query (str) – a string containing the query to make.
limit (int) – An int representing maximum number of results to be returned. Default value is 20.
lang (str) – A string to represent language to be used for result rendering from a list of BCP47 compliant Language Codes.
- Returns
requests.Response
object.- Raises
ApiError – If
status_code
of API response is not 200.- Return type
requests.models.Response
- get_reverse_geocoding(lat, lng, limit=1, lang='en-US')[source]
Get address for given latitude and longitude.
See further information here: Reverse Geocode
- Parameters
lat (float) – A float representing latitude of point.
lng (float) – A float representing longitude of point.
limit (int) – An int representing maximum number of results to be returned. Default value is 1.
lang (str) – A string to represent language to be used for result rendering from a list of BCP47 compliant Language Codes.
- Returns
requests.Response
object.- Raises
ApiError – If
status_code
of API response is not 200.- Return type
requests.models.Response
- get_search_discover(query, center=None, radius=None, country_codes=None, bounding_box=None, limit=None, lang=None)[source]
Search places using Location Services discover endpoint.
This method uses location services
discover
endpoint to search places based on query which is free-form text.- Parameters
query (str) – A string representing free-test query to search places.
center (Optional[List[float]]) – A list of latitude and longitude representing the center for search query.
radius (Optional[int]) – A radius in meters along with center for searching places.
country_codes (Optional[List]) – A list of ISO 3166-1 alpha-3 country codes.
bounding_box (Optional[List[float]]) – A bounding box, provided as west longitude, south latitude, east longitude, north latitude.
limit (Optional[int]) – An int representing maximum number of results to be returned.
lang (Optional[str]) – A string to represent language to be used for result rendering from a list of BCP47 compliant Language Codes.
- Returns
requests.Response
object.- Raises
ApiError – If
status_code
of API response is not 200.- Return type
requests.models.Response
- get_search_browse(center, radius=None, country_codes=None, bounding_box=None, categories=None, limit=None, name=None, lang=None)[source]
Get search results for places based on different filters such as categories or name.
- Parameters
center (List) – A list of latitude and longitude representing the center for search query.
radius (Optional[int]) – A radius in meters along with center for searching places.
country_codes (Optional[List]) – A list of ISO 3166-1 alpha-3 country codes.
bounding_box (Optional[List[float]]) – A bounding box, provided as west longitude, south latitude, east longitude, north latitude.
categories (Optional[List]) – A List of strings of category-ids.
limit (Optional[int]) – An int representing maximum number of results to be returned.
name (Optional[str]) – A string representing Full-text filter on POI names/titles.
lang (Optional[str]) – A string to represent language to be used for result rendering from a list of BCP47 compliant Language Codes.
- Returns
requests.Response
object.- Raises
ApiError – If
status_code
of API response is not 200.- Return type
requests.models.Response
- get_search_lookup(location_id, lang=None)[source]
Get search results by providing
location_id
.- Parameters
location_id (str) – A string representing id.
lang (Optional[str]) – A string to represent language to be used for result rendering from a list of BCP47 compliant Language Codes.
- Returns
requests.Response
object.- Raises
ApiError – If
status_code
of API response is not 200.- Return type
requests.models.Response