localitiesGeocodeLatLng

fun localitiesGeocodeLatLng(latlng: LatLng, components: List<String>? = null, language: String? = null, fields: Fields? = null, data: Data? = null, ccFormat: CcFormat? = null, listSubBuildings: Boolean? = null): List<LocalitiesGeocodeResponse>?

Geocode a locality or Reverse Geocode a latlng Provides details for an address or a geographic position. Either parameter address or latlng is required.

Return

LocalitiesGeocodeCollectionResponse

Parameters

latlng

The latlng parameter is used for reverse geocoding, it’s required if the address parameter is missing. (optional)

components

A grouping of places to which you would like to restrict your results. Components can be used to filter over countries. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code. For example: components=country:fr or components=country:fra would restrict your results to places within France and components=country:fr-fr returns locations only in Metropolitan France. Multiple countries must be passed as multiple country:XX filters, with the pipe character (|) as a separator. For example: components=country:gb|country:fr|country:be|country:sp|country:it would restrict your results to city names or postal codes within the United Kingdom, France, Belgium, Spain and Italy. (optional)

language

The language code, using ISO 3166-1 Alpha-2 or Alpha-3 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code request. (optional)

fields

Used to limit the returning fields when type=address (by default, and for other types localities, all fields are return). Only one field is available: geometry. By using this parameter you will limit content of responses to the geometry part. No address component will be returned. (optional)

data

Two values for this parameter: standard or advanced. By default, if the parameter is not defined, value is set as standard. The advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. A dedicated option subject to specific billing on your license is needed to use this parameter. Please contact us if you are interested in using this parameter and you do not have subscribed the proper option yet. (optional)

ccFormat

To specify the format for the short country code expected to be returned in the address_components field. Default is the format used to specify components or alpha2 if no components are specified. (optional)

listSubBuildings

allows to retrieve all addresses at the same location for a common street number or building. Results may contain an additional key "sub_buildings" with "public_id" and "description" values for every addresses at the same location sharing the same address components. (optional)

Throws

If the request is not correctly configured

Rethrows the OkHttp execute method exception

If the API returns an informational or redirection response

ClientException

If the API returns a client error response

ServerException

If the API returns a server error response