ExAws.Location.Places (ex_aws_location v0.1.0)

Copy Markdown

API calls for Amazon Location Service Places (the geo-places API).

Geocoding, reverse geocoding, place search, autocomplete and suggestions.

Every function returns an operation struct to be passed to ExAws.request/2.

Operations

  • autocomplete - Autocomplete
  • geocode - Geocode
  • get_place - GetPlace
  • reverse_geocode - ReverseGeocode
  • search_nearby - SearchNearby
  • search_text - SearchText
  • suggest - Suggest

See https://docs.aws.amazon.com/location/latest/APIReference/API_Operations_Amazon_Location_Service_Places_V2.html

Summary

Functions

Autocomplete completes potential places and addresses as the user types, based on the partial input. The API enhances the efficiency and accuracy of address by completing query based on a few entered keystrokes. It helps you by completing partial queries with valid address completion. Also, the API supports the filtering of results based on geographic location, country, or specific place types, and can be tailored using optional parameters like language and political views. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

Geocode converts a textual address or place into geographic coordinates. You can obtain geographic coordinates, address component, and other related information. It supports flexible queries, including free-form text or structured queries with components like street names, postal codes, and regions. The Geocode API can also provide additional features such as time zone information and the inclusion of political views. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

GetPlace finds a place by its unique ID. A PlaceId is returned by other place operations.

ReverseGeocode converts geographic coordinates into a human-readable address or place. You can obtain address component, and other related information such as place type, category, street information. The Reverse Geocode API supports filtering to on place type so that you can refine result based on your need. Also, The Reverse Geocode API can also provide additional features such as time zone information and the inclusion of political views.

SearchNearby queries for points of interest within a radius from a central coordinates, returning place results with optional filters such as categories, business chains, food types and more. The API returns details such as a place name, address, phone, category, food type, contact, opening hours. Also, the API can return phonemes, time zones and more based on requested parameters. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

SearchText searches for geocode and place information. You can then complete a follow-up query suggested from the Suggest API via a query id.

Suggest provides intelligent predictions or recommendations based on the user's input or context, such as relevant places, points of interest, query terms or search category. It is designed to help users find places or point of interests candidates or identify a follow on query based on incomplete or misspelled queries. It returns a list of possible matches or refinements that can be used to formulate a more accurate query. Users can select the most appropriate suggestion and use it for further searching. The API provides options for filtering results by location and other attributes, and allows for additional features like phonemes and timezones. The response includes refined query terms and detailed place information.

Types

autocomplete_opts()

@type autocomplete_opts() :: [
  additional_features: [String.t()],
  bias_position: [number()],
  filter: ExAws.Location.Places.AutocompleteFilter.t(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  max_results: integer(),
  political_view: String.t(),
  postal_code_mode: String.t()
]

geocode_opts()

@type geocode_opts() :: [
  additional_features: [String.t()],
  address_names_mode: String.t(),
  address_translations: [String.t()],
  bias_position: [number()],
  filter: ExAws.Location.Places.GeocodeFilter.t(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  max_results: integer(),
  political_view: String.t(),
  postal_code_mode: String.t(),
  query_components: ExAws.Location.Places.GeocodeQueryComponents.t(),
  query_text: String.t()
]

get_place_opts()

@type get_place_opts() :: [
  additional_features: [String.t()],
  address_names_mode: String.t(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  political_view: String.t()
]

reverse_geocode_opts()

@type reverse_geocode_opts() :: [
  additional_features: [String.t()],
  address_names_mode: String.t(),
  filter: ExAws.Location.Places.ReverseGeocodeFilter.t(),
  heading: number(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  max_results: integer(),
  political_view: String.t(),
  query_radius: integer()
]

search_nearby_opts()

@type search_nearby_opts() :: [
  additional_features: [String.t()],
  filter: ExAws.Location.Places.SearchNearbyFilter.t(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  max_results: integer(),
  next_token: String.t(),
  political_view: String.t(),
  query_radius: integer()
]

search_text_opts()

@type search_text_opts() :: [
  additional_features: [String.t()],
  bias_position: [number()],
  filter: ExAws.Location.Places.SearchTextFilter.t(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  max_results: integer(),
  next_token: String.t(),
  political_view: String.t(),
  query_id: String.t(),
  query_text: String.t(),
  travel_mode: String.t()
]

suggest_opts()

@type suggest_opts() :: [
  additional_features: [String.t()],
  bias_position: [number()],
  filter: ExAws.Location.Places.SuggestFilter.t(),
  intended_use: String.t(),
  key: String.t(),
  language: String.t(),
  max_query_refinements: integer(),
  max_results: integer(),
  political_view: String.t(),
  travel_mode: String.t()
]

Functions

autocomplete(query_text, opts \\ [])

@spec autocomplete(String.t(), autocomplete_opts()) :: ExAws.Operation.JSON.t()

Autocomplete completes potential places and addresses as the user types, based on the partial input. The API enhances the efficiency and accuracy of address by completing query based on a few entered keystrokes. It helps you by completing partial queries with valid address completion. Also, the API supports the filtering of results based on geographic location, country, or specific place types, and can be tailored using optional parameters like language and political views. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

For more information, see Autocomplete in the Amazon Location Service Developer Guide.

Parameters

  • query_text - The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.

Options

  • :additional_features - A list of optional additional parameters that can be requested for each result. Valid values: Core.

  • :bias_position - The position in longitude and latitude that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in [lng, lat] and in the WGS 84 format.

  • :filter - A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Currently, Autocomplete does not support storage of results. Valid values: SingleUse.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.

  • :max_results - An optional limit for the number of results returned in a single call.

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.

  • :postal_code_mode - The PostalCodeMode affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value EnumerateSpannedLocalities, all cities in that postal code are returned. If it's populated with the value EnumerateSpannedDistricts, all combinations of the postal code with the corresponding district and city names are returned. Valid values: MergeAllSpannedLocalities, EnumerateSpannedLocalities, EnumerateSpannedDistricts.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_Autocomplete.html

geocode(opts \\ [])

@spec geocode(geocode_opts()) :: ExAws.Operation.JSON.t()

Geocode converts a textual address or place into geographic coordinates. You can obtain geographic coordinates, address component, and other related information. It supports flexible queries, including free-form text or structured queries with components like street names, postal codes, and regions. The Geocode API can also provide additional features such as time zone information and the inclusion of political views. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

For more information, see Geocode in the Amazon Location Service Developer Guide.

Options

  • :additional_features - A list of optional additional parameters, such as time zone, that can be requested for each result. Valid values: TimeZone, Access, SecondaryAddresses, Intersections.

  • :address_names_mode - Specifies how address names are returned. If not set, the service returns normalized (official) names by default. When set to Matched, address names in the response are based on the input query rather than official names. When set to Administrative, the service returns the official administrative names for address components. Administrative currently applies only to addresses in the United States. Valid values: Matched, Administrative.

  • :address_translations - Specifies which address components to include translations for. Translations include all name variants and alternative names for the requested fields in all available languages. Valid values are District, Locality, Region, and SubRegion. Valid values: District, Locality, Region, SubRegion.

  • :bias_position - The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in [lng, lat] and in the WGS 84 format.

  • :filter - A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: SingleUse, Storage.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.

  • :max_results - An optional limit for the number of results returned in a single call.

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.

  • :postal_code_mode - The PostalCodeMode affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value EnumerateSpannedLocalities, all cities in that postal code are returned. If it's populated with the value EnumerateSpannedDistricts, all combinations of the postal code with the corresponding district and city names are returned. Valid values: MergeAllSpannedLocalities, EnumerateSpannedLocalities, EnumerateSpannedDistricts.

  • :query_components -

  • :query_text - The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_Geocode.html

get_place(place_id, opts \\ [])

@spec get_place(String.t(), get_place_opts()) :: ExAws.Operation.RestQuery.t()

GetPlace finds a place by its unique ID. A PlaceId is returned by other place operations.

For more information, see GetPlace in the Amazon Location Service Developer Guide.

Parameters

  • place_id - The PlaceId of the place you wish to receive the information for.

Options

  • :additional_features - A list of optional additional parameters such as time zone that can be requested for each result. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the TimeZone value. Valid values: TimeZone, Phonemes, Access, Contact, SecondaryAddresses, CrossReferences.

  • :address_names_mode - Specifies how address names are returned. When set to Administrative, the service returns the official administrative names for address components. Administrative currently applies only to addresses in the United States. Valid values: Administrative.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: SingleUse, Storage.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the following codes: en, id, km, lo, ms, my, pt, th, tl, vi, zh

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_GetPlace.html

reverse_geocode(query_position, opts \\ [])

@spec reverse_geocode([number()], reverse_geocode_opts()) :: ExAws.Operation.JSON.t()

ReverseGeocode converts geographic coordinates into a human-readable address or place. You can obtain address component, and other related information such as place type, category, street information. The Reverse Geocode API supports filtering to on place type so that you can refine result based on your need. Also, The Reverse Geocode API can also provide additional features such as time zone information and the inclusion of political views.

For more information, see Reverse Geocode in the Amazon Location Service Developer Guide.

Parameters

  • query_position - The position in World Geodetic System (WGS 84) format: [longitude, latitude] for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position

Options

  • :additional_features - A list of optional additional parameters, such as time zone that can be requested for each result. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the TimeZone value. Valid values: TimeZone, Access, Intersections.

  • :address_names_mode - Specifies how address names are returned. When set to Administrative, the service returns the official administrative names for address components. Administrative currently applies only to addresses in the United States. Valid values: Administrative.

  • :filter - A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

  • :heading - The heading in degrees from true north in a navigation context. The heading is measured as the angle clockwise from the North direction.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Valid values: SingleUse, Storage.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the following codes: en, id, km, lo, ms, my, pt, th, tl, vi, zh

  • :max_results - An optional limit for the number of results returned in a single call.

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • :query_radius - The maximum distance in meters from the QueryPosition from which a result will be returned. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only up to a maximum value of 100,000.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_ReverseGeocode.html

search_nearby(query_position, opts \\ [])

@spec search_nearby([number()], search_nearby_opts()) :: ExAws.Operation.JSON.t()

SearchNearby queries for points of interest within a radius from a central coordinates, returning place results with optional filters such as categories, business chains, food types and more. The API returns details such as a place name, address, phone, category, food type, contact, opening hours. Also, the API can return phonemes, time zones and more based on requested parameters. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

For more information, see Search Nearby in the Amazon Location Service Developer Guide.

Parameters

  • query_position - The position in World Geodetic System (WGS 84) format: [longitude, latitude] for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position

Options

  • :additional_features - A list of optional additional parameters, such as time zone, that can be requested for each result. Valid values: TimeZone, Phonemes, Access, Contact, CrossReferences.

  • :filter - A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers. Valid values: SingleUse, Storage.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.

  • :max_results - An optional limit for the number of results returned in a single call.

  • :next_token - If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page.

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.

  • :query_radius - The maximum distance in meters from the QueryPosition from which a result will be returned.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_SearchNearby.html

search_text(opts \\ [])

@spec search_text(search_text_opts()) :: ExAws.Operation.JSON.t()

SearchText searches for geocode and place information. You can then complete a follow-up query suggested from the Suggest API via a query id.

For more information, see Search Text in the Amazon Location Service Developer Guide.

Options

  • :additional_features - A list of optional additional parameters, such as time zone, that can be requested for each result. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the TimeZone value. Valid values: TimeZone, Phonemes, Access, Contact, CrossReferences.

  • :bias_position - The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in [lng, lat] and in the WGS 84 format.

  • :filter - A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Valid values: SingleUse, Storage.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the following codes: en, id, km, lo, ms, my, pt, th, tl, vi, zh

  • :max_results - An optional limit for the number of results returned in a single call.

  • :next_token - If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page.

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not available in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • :query_id - The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API. Not available in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • :query_text - The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.

  • :travel_mode - Indicates the mode of mobility used by the end user. This is used to improve the relevance of search results. Valid values are Car, Scooter, and Truck. Valid values: Car, Scooter, Truck.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_SearchText.html

suggest(query_text, opts \\ [])

@spec suggest(String.t(), suggest_opts()) :: ExAws.Operation.JSON.t()

Suggest provides intelligent predictions or recommendations based on the user's input or context, such as relevant places, points of interest, query terms or search category. It is designed to help users find places or point of interests candidates or identify a follow on query based on incomplete or misspelled queries. It returns a list of possible matches or refinements that can be used to formulate a more accurate query. Users can select the most appropriate suggestion and use it for further searching. The API provides options for filtering results by location and other attributes, and allows for additional features like phonemes and timezones. The response includes refined query terms and detailed place information.

For more information, see Suggest in the Amazon Location Service Developer Guide.

Parameters

  • query_text - The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.

Options

  • :additional_features - A list of optional additional parameters, such as time zone, that can be requested for each result. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the Core and TimeZone values. Valid values: Core, TimeZone, Phonemes, Access, CrossReferences.

  • :bias_position - The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in [lng, lat] and in the WGS 84 format.

  • :filter - A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.

  • :intended_use - Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Currently, Suggest does not support storage of results. Valid values: SingleUse.

  • :key - Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • :language - A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the following codes: en, id, km, lo, ms, my, pt, th, tl, vi, zh

  • :max_query_refinements - Maximum number of query terms to be returned for use with a search text query. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • :max_results - An optional limit for the number of results returned in a single call.

  • :political_view - The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • :travel_mode - Indicates the mode of mobility used by the end user. This is used to improve the relevance of search results. Valid values are Car, Scooter, and Truck. Valid values: Car, Scooter, Truck.

See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_Suggest.html