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- Autocompletegeocode- Geocodeget_place- GetPlacereverse_geocode- ReverseGeocodesearch_nearby- SearchNearbysearch_text- SearchTextsuggest- Suggest
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
@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() ]
@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() ]
@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() ]
@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
@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 toSingleUse(not stored). Currently,Autocompletedoes 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- ThePostalCodeModeaffects 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 valueEnumerateSpannedLocalities, all cities in that postal code are returned. If it's populated with the valueEnumerateSpannedDistricts, 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
@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 toMatched, address names in the response are based on the input query rather than official names. When set toAdministrative, the service returns the official administrative names for address components.Administrativecurrently 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 areDistrict,Locality,Region, andSubRegion. 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 toSingleUse(not stored). Not supported inap-southeast-1andap-southeast-5regions 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- ThePostalCodeModeaffects 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 valueEnumerateSpannedLocalities, all cities in that postal code are returned. If it's populated with the valueEnumerateSpannedDistricts, 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
@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- ThePlaceIdof 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-1andap-southeast-5regions support only theTimeZonevalue. Valid values:TimeZone,Phonemes,Access,Contact,SecondaryAddresses,CrossReferences.:address_names_mode- Specifies how address names are returned. When set toAdministrative, the service returns the official administrative names for address components.Administrativecurrently 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 toSingleUse(not stored). Not supported inap-southeast-1andap-southeast-5regions 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-1andap-southeast-5regions 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 inap-southeast-1andap-southeast-5regions for GrabMaps customers.
See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_GetPlace.html
@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-1andap-southeast-5regions support only theTimeZonevalue. Valid values:TimeZone,Access,Intersections.:address_names_mode- Specifies how address names are returned. When set toAdministrative, the service returns the official administrative names for address components.Administrativecurrently 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 toSingleUse(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-1andap-southeast-5regions 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 inap-southeast-1andap-southeast-5regions 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-1andap-southeast-5regions support only up to a maximum value of 100,000.
See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_ReverseGeocode.html
@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 toSingleUse(not stored). Not supported inap-southeast-1andap-southeast-5regions 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- IfnextTokenis returned, there are more results available. The value ofnextTokenis 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
@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-1andap-southeast-5regions support only theTimeZonevalue. 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 toSingleUse(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-1andap-southeast-5regions 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- IfnextTokenis returned, there are more results available. The value ofnextTokenis 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 inap-southeast-1andap-southeast-5regions 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 inap-southeast-1andap-southeast-5regions 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 areCar,Scooter, andTruck. Valid values:Car,Scooter,Truck.
See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_SearchText.html
@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-1andap-southeast-5regions support only theCoreandTimeZonevalues. 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 toSingleUse(not stored). Currently,Suggestdoes 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-1andap-southeast-5regions 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 inap-southeast-1andap-southeast-5regions 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 inap-southeast-1andap-southeast-5regions 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 areCar,Scooter, andTruck. Valid values:Car,Scooter,Truck.
See https://docs.aws.amazon.com/location/latest/APIReference/API_geoplaces_Suggest.html