public abstract class

Locator

extends Object
java.lang.Object
   ↳ com.esri.core.tasks.geocode.Locator

Class Overview

Abstract class for using and creating online/offline geocoders. The Locator class can be used to convert an address to a point (geocode) or vice-versa (reverse geocode).

To create a locator using an online service, use createOnlineLocator(), createOnlineLocator(String), or createOnlineLocator(String, UserCredentials). To create a locator using local data, use createLocalLocator(String).

To geocode using address fields, use the geocode method. If you are using a locator or geocode service which supports single-line geocoding, you can use the find method. Each type of method has overloads which execute either synchronously (returning a result) or asynchronously (returning a Future and with a callback).

To reverse geocode, use the reverseGeocode method. Again there are overloads of this method for synchronous and asynchronous execution, as well as with or without spatial reference parameters.

Summary

Public Methods
Future<BatchGeocodeResult> batchGeocode(List<Map<String, String>> addresses, SpatialReference outSR, CallbackListener<BatchGeocodeResult> callback)
Asynchronously matches addresses to locations.
abstract BatchGeocodeResult batchGeocode(List<Map<String, String>> addresses, SpatialReference outSR)
Matches addresses to locations.
static Locator createLocalLocator(String path)
Creates a locator using local data.
static Locator createLocalLocator(String path, LocatorSettings settings)
Creates a locator using local data.
static Locator createOnlineLocator(String url)
Creates a locator using an online geocode service URL.
static Locator createOnlineLocator(String url, UserCredentials credentials)
Creates a locator using an online geocode service URL and credentials for the service.
static Locator createOnlineLocator()
Constructs a default locator object.
void dispose()
Cleanup any resources that the locator might be holding onto.
Future<List<LocatorGeocodeResult>> find(LocatorSuggestionResult suggestResult, int maxLocations, List<String> outFields, SpatialReference outSR, CallbackListener<List<LocatorGeocodeResult>> callback)
This asynchronous geocoding find operation can be used in conjunction with suggest(LocatorSuggestionParameters) or suggest(LocatorSuggestionParameters, CallbackListener) to retrieve more detailed information about geocoding suggestions.
abstract List<LocatorGeocodeResult> find(LocatorFindParameters findParams)
Executes an operation to find location candidates for a given address, POI, or String.
abstract List<LocatorGeocodeResult> find(LocatorSuggestionResult suggestResult, int maxLocations, List<String> outFields, SpatialReference outSR)
This geocoding find operation can be used in conjunction with suggest(LocatorSuggestionParameters) or suggest(LocatorSuggestionParameters, CallbackListener) to retrieve more detailed information about geocoding suggestions.
Future<List<LocatorGeocodeResult>> find(LocatorFindParameters findParams, CallbackListener<List<LocatorGeocodeResult>> callback)
Executes an asynchronous operation to find location candidates for a given address, POI, or String.
static Future<LocatorReverseGeocodeResult> findAddress(double lat, double lon, Locator locator, CallbackListener<LocatorReverseGeocodeResult> callback)
Static method to find an address for a location defined in latitude and longitude.
static Future<List<LocatorGeocodeResult>> findLocation(String name, Locator locator, CallbackListener<List<LocatorGeocodeResult>> callback)
Static method to generate location candidates (latitude longitude coordinates) for a given address or place name.
abstract List<LocatorGeocodeResult> geocode(LocatorGeocodeParameters geocodeParams)
Executes a geocoding operation to find location candidates for a given address.
abstract List<LocatorGeocodeResult> geocode(Map<String, String> addressFields, List<String> outFields)
Executes a geocoding operation to find location candidates for a given address.
Future<List<LocatorGeocodeResult>> geocode(Map<String, String> addressFields, List<String> outFields, SpatialReference outSR, CallbackListener<List<LocatorGeocodeResult>> callback)
Executes an asynchronous geocoding operation to find location candidates for a given address.
abstract List<LocatorGeocodeResult> geocode(Map<String, String> addressFields, List<String> outFields, SpatialReference outSR)
Executes a geocoding operation to find location candidates for a given address.
Future<List<LocatorGeocodeResult>> geocode(Map<String, String> addressFields, List<String> outFields, CallbackListener<List<LocatorGeocodeResult>> callback)
Executes an asynchronous geocoding operation to find location candidates for a given address.
Future<List<LocatorGeocodeResult>> geocode(LocatorGeocodeParameters geocodeParams, CallbackListener<List<LocatorGeocodeResult>> callback)
Executes an asynchronous geocoding operation to find location candidates for a given address.
abstract LocatorServiceInfo getInfo()
Returns the information about the online Geocode service or local Locator data.
abstract String getUrl()
Returns the URL of the Geocode service used by this instance of the Locator.
abstract LocatorReverseGeocodeResult reverseGeocode(Point point, double distance)
Executes a reverse-geocoding operation to find address candidates for a given location.
abstract LocatorReverseGeocodeResult reverseGeocode(Point point, double distance, SpatialReference inSR, SpatialReference outSR)

Executes a reverse-geocoding operation to find address candidates for a given location.

Future<LocatorReverseGeocodeResult> reverseGeocode(Point point, double distance, SpatialReference inSR, SpatialReference outSR, CallbackListener<LocatorReverseGeocodeResult> callback)

Executes an asynchronous reverse-geocoding operation to find address candidates for a given location.

Future<LocatorReverseGeocodeResult> reverseGeocode(Point point, double distance, CallbackListener<LocatorReverseGeocodeResult> callback)
Executes an asynchronous reverse-geocoding operation to find address candidates for a given location.
Future<List<LocatorSuggestionResult>> suggest(LocatorSuggestionParameters suggestParams, CallbackListener<List<LocatorSuggestionResult>> callback)
Geocoding suggestions provide a mechanism for allowing character-by-character auto-complete.
abstract List<LocatorSuggestionResult> suggest(LocatorSuggestionParameters suggestParams)
Geocoding suggestions provide a mechanism for allowing character-by-character auto-complete.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Future<BatchGeocodeResult> batchGeocode (List<Map<String, String>> addresses, SpatialReference outSR, CallbackListener<BatchGeocodeResult> callback)

Asynchronously matches addresses to locations. Results can be matched to input using the "ResultID" attribute in the results. This attribute matches the index of the address e.g. if three addresses are supplied then the matches would have result IDs of 0, 1 and 2. If the supplied addresses have an attribute "OBJECTID" then the result ID will be referenced to that value.

Note, batch geocoding is only supported for Locators using ArcGIS services, and is not usable by Locators created with createLocalLocator(String), createLocalLocator(String, LocatorSettings).

Parameters
addresses the list of addresses to find matches for; each address is a Map of address fields and their corresponding values
outSR the spatial reference the location candidates will be projected to
Returns
  • the result of the batch geocoding operation

public abstract BatchGeocodeResult batchGeocode (List<Map<String, String>> addresses, SpatialReference outSR)

Matches addresses to locations. Results can be matched to input using the "ResultID" attribute in the results. This attribute matches the index of the address e.g. if three addresses are supplied then the matches would have result IDs of 0, 1 and 2. If the supplied addresses have an attribute "OBJECTID" then the result ID will be referenced to that value.

Note, batch geocoding is only supported for Locators using ArcGIS services, and is not usable by Locators created with createLocalLocator(String), createLocalLocator(String, LocatorSettings).

Parameters
addresses the list of addresses to find matches for; each address is a Map of address fields and their corresponding values
outSR the spatial reference the location candidates will be projected to
Returns
  • the result of the batch geocoding operation
Throws
Exception any exception occurring during the batch geocoding operation

public static Locator createLocalLocator (String path)

Creates a locator using local data. All locator files (*.lox, *.loc, *.locb) must be present.

Parameters
path The absolute path to the ".loc" file e.g. "/mnt/sdcard/ArcGIS/locator.loc"
Returns
  • A locator object using local data.

public static Locator createLocalLocator (String path, LocatorSettings settings)

Creates a locator using local data. All locator files (*.lox, *.loc, *.locb) must be present. LocatorSettings controls various memory and performance settings.

Parameters
path The absolute path to the ".loc" file e.g. "/mnt/sdcard/ArcGIS/locator.loc"
settings The LocatorSettings object for memory and performance adjustments.
Returns
  • A locator object using local data.

public static Locator createOnlineLocator (String url)

Creates a locator using an online geocode service URL.

Parameters
url URL to the REST endpoint of a Geocode service
Returns
  • A locator object using an online service.

public static Locator createOnlineLocator (String url, UserCredentials credentials)

Creates a locator using an online geocode service URL and credentials for the service.

Parameters
url URL to the REST endpoint of a Geocode service
credentials the credentials used for accessing a secure Geocode service
Returns
  • A locator object using an online service.

public static Locator createOnlineLocator ()

Constructs a default locator object.
The default locator uses the ArcGIS online world geocoding service.
The REST endpoint of the service is "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer".

Returns
  • A locator object using an online service.

public void dispose ()

Cleanup any resources that the locator might be holding onto. This is only applicable for the Locators backed by local data.

public Future<List<LocatorGeocodeResult>> find (LocatorSuggestionResult suggestResult, int maxLocations, List<String> outFields, SpatialReference outSR, CallbackListener<List<LocatorGeocodeResult>> callback)

This asynchronous geocoding find operation can be used in conjunction with suggest(LocatorSuggestionParameters) or suggest(LocatorSuggestionParameters, CallbackListener) to retrieve more detailed information about geocoding suggestions. Suggestions only contain textual information for display purposes, so this method can be used to retrieve information such as geometry, output fields, and scores. Some suggestions may also be returned as collections ("Coffee Shops" for instance), making this method useful for expanding those results to recognizable names and addresses.

Note, this method is currently unsupported for Locators backed by local data. Attempting to call it with a Locator created with #LocatorcreateLocalLocator(String) will throw an exception.

Parameters
suggestResult The result of a suggestion operation suggest(LocatorSuggestionParameters).
maxLocations The number of locations to return. When using a suggestion that is a collection (isCollection()), the recommended minimum value is 3 to 5.
outFields The desired output fields on the results. Pass "*" to return all output fields. If null or empty list is specified, no output fields will be returned, but each LocatorGeocodeResult will still have an address, geometry, and score.
outSR The desired output spatial reference of the returned results.
callback A callback to be invoked when asynchronous results are ready or an error has occurred.
Returns

public abstract List<LocatorGeocodeResult> find (LocatorFindParameters findParams)

Executes an operation to find location candidates for a given address, POI, or String.
Note: If using an online Locator, this method will only work if the find operation is supported by the service, like in the world geocoding service hosted on ArcGIS online. You may obtain an exception from other geocoding services that do not support this operation.

The Find operation of a geocoding service is used for single field geocoding, and supports finding the following types of locations:

  • Street addresses: 380 New York St, Redlands, CA 92373
  • Administrative place names, such as city/county/state/province/country names: Seattle, Washington
  • Postal codes: 92591 USA
  • Points of interest (POI) and businesses: 'Disneyland', 'banks in Paris'

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

The location candidates will be returned in the spatial reference passed in the parameters - passing null will return the locations in the default spatial reference defined for the service/local data.

Parameters
findParams A LocatorFindParameters object containing the single line String to be geocoded and appropriate input/output settings.
Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public abstract List<LocatorGeocodeResult> find (LocatorSuggestionResult suggestResult, int maxLocations, List<String> outFields, SpatialReference outSR)

This geocoding find operation can be used in conjunction with suggest(LocatorSuggestionParameters) or suggest(LocatorSuggestionParameters, CallbackListener) to retrieve more detailed information about geocoding suggestions. Suggestions only contain textual information for display purposes, so this method can be used to retrieve information such as geometry, output fields, and scores. Some suggestions may also be returned as collections ("Coffee Shops" for instance), making this method useful for expanding those results to recognizable names and addresses.

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

Note, this method is currently unsupported for Locators backed by local data. Attempting to call it with a Locator created with createLocalLocator(String) will throw an exception.

Parameters
suggestResult The result of a suggestion operation suggest(LocatorSuggestionParameters).
maxLocations The number of locations to return. When using a suggestion that is a collection (isCollection()), the recommended minimum value is 3 to 5.
outFields The desired output fields on the results. Pass "*" to return all output fields. If null or empty list is specified, no output fields will be returned, but each LocatorGeocodeResult will still have an address, geometry, and score.
outSR The desired output spatial reference of the returned results.
Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator, unsupported operation

public Future<List<LocatorGeocodeResult>> find (LocatorFindParameters findParams, CallbackListener<List<LocatorGeocodeResult>> callback)

Executes an asynchronous operation to find location candidates for a given address, POI, or String.
Note: If using an online Locator, this method will only work if the find operation is supported by the service, like in the world geocoding service hosted on ArcGIS online. You may obtain an exception from other geocoding services that do not support this operation.

The Find operation of a geocoding service is used for single field geocoding, and supports finding the following types of locations:

  • Street addresses: 380 New York St, Redlands, CA 92373
  • Administrative place names, such as city/county/state/province/country names: Seattle, Washington
  • Postal codes: 92591 USA
  • Points of interest (POI) and businesses: 'Disneyland', 'banks in Paris'

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

The location candidates will be returned in the spatial reference passed in the parameters - passing null will return the locations in the default spatial reference defined for the service/local data.

Parameters
findParams A LocatorFindParameters object containing the single line String to be geocoded and appropriate input/output settings.
callback the CallbackListener to be invoked upon the successful completion of the asynchronous call
Returns

public static Future<LocatorReverseGeocodeResult> findAddress (double lat, double lon, Locator locator, CallbackListener<LocatorReverseGeocodeResult> callback)

Static method to find an address for a location defined in latitude and longitude. This method simplifies the workflow of setting parameters and getting a result from a Locator. The operation can be cancelled through the Future. When an operation is cancelled, the Callback won't be invoked. However, the request to the operation may be sent before the operation is cancelled.

Parameters
lat latitude of the location.
lon longitude of the location.
locator the geocode service of ArcGIS Server to use. If null, a default locator using the ArcGIS online world geocoding service will be used. The endpoint of this service is "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer".
callback Callback to invoke when the operation is complete or on error.
Returns
  • a Future which resolves to a LocatorReverseGeocodeResult if the operation is complete.

public static Future<List<LocatorGeocodeResult>> findLocation (String name, Locator locator, CallbackListener<List<LocatorGeocodeResult>> callback)

Static method to generate location candidates (latitude longitude coordinates) for a given address or place name. This method simplifies the workflow of setting parameters and getting a result from a Locator. The operation can be cancelled via the Future. When an operation is cancelled, the Callback won't be invoked. However, the request to the operation may be sent before the operation is cancelled.

Parameters
name the address to look up.
locator the ArcGIS Server geocode service to use. If null, a default locator using the ArcGIS online world geocoding service will be used. The endpoint of this service is "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer".
callback Callback to invoke when the operation is complete or on error.
Returns
  • a Future which resolves to a LocatorGeocodeResult if the operation is complete.

public abstract List<LocatorGeocodeResult> geocode (LocatorGeocodeParameters geocodeParams)

Executes a geocoding operation to find location candidates for a given address.

The output fields can be specified using setOutFields(List). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

The location candidates will be returned in the spatial reference specified in setOutSR(SpatialReference). Passing null will return the locations in the default spatial reference defined for the service/local data.

Candidates can be spatially filtered using a search extent specified in setSearchExtent(com.esri.core.geometry.Envelope, SpatialReference).

Parameters
geocodeParams a LocatorGeocodeParameters containing the geocoding parameters
Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public abstract List<LocatorGeocodeResult> geocode (Map<String, String> addressFields, List<String> outFields)

Executes a geocoding operation to find location candidates for a given address.

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

Parameters
addressFields a Map containing the address fields and their corresponding values
outFields a List of output fields to be returned for each address candidate
Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public Future<List<LocatorGeocodeResult>> geocode (Map<String, String> addressFields, List<String> outFields, SpatialReference outSR, CallbackListener<List<LocatorGeocodeResult>> callback)

Executes an asynchronous geocoding operation to find location candidates for a given address.

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

The location candidates will be returned in the spatial reference passed in as an argument - passing null will return the locations in the default spatial reference defined for the service/local data.

Parameters
addressFields a Map containing the address fields and their corresponding values
outFields The desired output fields on the results. Pass "*" to return all output fields. If null or empty list is specified, no output fields will be returned, but each LocatorGeocodeResult will still have an address, geometry, and score.
outSR a spatial reference the location candidates will be projected to
callback the CallbackListener to be invoked upon the successful completion of the asynchronous call
Returns

public abstract List<LocatorGeocodeResult> geocode (Map<String, String> addressFields, List<String> outFields, SpatialReference outSR)

Executes a geocoding operation to find location candidates for a given address.

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

The location candidates will be returned in the spatial reference passed in as an argument - passing null will return the locations in the default spatial reference defined for the service/local data.

Parameters
addressFields a Map containing the address fields and their corresponding values
outFields The desired output fields on the results. Pass "*" to return all output fields. If null or empty list is specified, no output fields will be returned, but each LocatorGeocodeResult will still have an address, geometry, and score.
outSR a spatial reference the location candidates will be projected to
Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public Future<List<LocatorGeocodeResult>> geocode (Map<String, String> addressFields, List<String> outFields, CallbackListener<List<LocatorGeocodeResult>> callback)

Executes an asynchronous geocoding operation to find location candidates for a given address.

Output fields can be specified to retrieve information in addition to the address, geometry, and score returned on geocoding results. Available output fields can be found using getCandidateFields(). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

Parameters
addressFields a Map containing the address fields and their corresponding values
outFields The desired output fields on the results. Pass "*" to return all output fields. If null or empty list is specified, no output fields will be returned, but each LocatorGeocodeResult will still have an address, geometry, and score.
callback the CallbackListener to be invoked upon the successful completion of the asynchronous call
Returns

public Future<List<LocatorGeocodeResult>> geocode (LocatorGeocodeParameters geocodeParams, CallbackListener<List<LocatorGeocodeResult>> callback)

Executes an asynchronous geocoding operation to find location candidates for a given address.

The output fields can be specified using setOutFields(List). A list with an asterisk ("*") can be used to return all fields. If null or an empty list is specified, no output fields will be returned on the results.

The location candidates will be returned in the spatial reference specified in setOutSR(SpatialReference). Passing null will return the locations in the default spatial reference defined for the service/local data.

Candidates can be spatially filtered using a search extent specified in setSearchExtent(com.esri.core.geometry.Envelope, SpatialReference).

Parameters
geocodeParams a LocatorGeocodeParameters containing the geocoding parameters
callback the CallbackListener to be invoked upon the successful completion of the asynchronous call
Returns

public abstract LocatorServiceInfo getInfo ()

Returns the information about the online Geocode service or local Locator data. This information includes candidate fields, service properties, spatial reference, single line address field, and address fields.

Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public abstract String getUrl ()

Returns the URL of the Geocode service used by this instance of the Locator. In the case of a local Locator, this will be the file path to the locator.

Returns
  • the URL of the Geocode service used by this instance of the Locator

public abstract LocatorReverseGeocodeResult reverseGeocode (Point point, double distance)

Executes a reverse-geocoding operation to find address candidates for a given location.
A distance in meters from the given location within which a matching address should be searched must be provided, 0 if none is desired.

Parameters
point the location to search for address candidates.
distance the distance in meters from the given location within which a matching address should be searched.
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public abstract LocatorReverseGeocodeResult reverseGeocode (Point point, double distance, SpatialReference inSR, SpatialReference outSR)

Executes a reverse-geocoding operation to find address candidates for a given location.
A distance in meters from the given location within which a matching address should be searched must be provided, 0 if none is desired.
The input spatial reference can be specified if the location coordinates are in a different spatial reference than the one expected by the service.
An output spatial reference can be specified if the coordinates for the address candidates are wanted in a different spatial reference than the one defined in the service.
Passing null for either of the two spatial references will result in the default service/local data spatial reference being used.

Parameters
point the location to search for address candidates.
distance the distance in meters from the given location within which a matching address should be searched.
inSR the input spatial reference for the location.
outSR the output spatial reference for the location of the address candidates
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator

public Future<LocatorReverseGeocodeResult> reverseGeocode (Point point, double distance, SpatialReference inSR, SpatialReference outSR, CallbackListener<LocatorReverseGeocodeResult> callback)

Executes an asynchronous reverse-geocoding operation to find address candidates for a given location.
A distance in meters from the given location within which a matching address should be searched must be provided, 0 if none is desired.
The input spatial reference can be specified if the location coordinates are in a different spatial reference than the one expected by the service.
An output spatial reference can be specified if the coordinates for the address candidates are wanted in a different spatial reference than the one defined in the service.
Passing null for either of the two spatial references will result in the default service/local data spatial reference being used.

Parameters
point the location to search for address candidates.
distance the distance in meters from the given location within which a matching address should be searched.
inSR the input spatial reference for the location.
outSR the output spatial reference for the location of the address candidates
callback the CallbackListener to be invoked upon the successful completion of the asynchronous call
Returns

public Future<LocatorReverseGeocodeResult> reverseGeocode (Point point, double distance, CallbackListener<LocatorReverseGeocodeResult> callback)

Executes an asynchronous reverse-geocoding operation to find address candidates for a given location.
A distance in meters from the given location within which a matching address should be searched must be provided, 0 if none is desired.

Parameters
point the location to search for address candidates.
distance the distance in meters from the given location within which a matching address should be searched.
callback the CallbackListener to be invoked upon the successful completion of the asynchronous call
Returns

public Future<List<LocatorSuggestionResult>> suggest (LocatorSuggestionParameters suggestParams, CallbackListener<List<LocatorSuggestionResult>> callback)

Geocoding suggestions provide a mechanism for allowing character-by-character auto-complete. By passing in text entry and an optional location, quick, asynchronous results can be found for client display purposes. Suggestions are not limited to addresses, they can also be used for POIs (Points of Interest) and categories:

  • Address: 380 New York St.
  • POI: Starbucks
  • Category: Coffee Shops
A Suggestion result only contains textual display information. To obtain more detailed information, such as geometry, the result can be passed to a geocoding find operation find(LocatorSuggestionResult, int, List, SpatialReference).

Note, this method is currently unsupported for Locators backed by local data. Attempting to call it with a Locator created with #LocatorcreateLocalLocator(String) will throw an exception.

Parameters
suggestParams A LocatorSuggestionParameters containing textual input and optional location information.
callback A callback to be invoked when asynchronous results are ready or an error has occurred.
Returns

public abstract List<LocatorSuggestionResult> suggest (LocatorSuggestionParameters suggestParams)

Geocoding suggestions provide a mechanism for allowing character-by-character auto-complete. By passing in text entry and an optional location, results can be quickly found for client display purposes. Suggestions are not limited to addresses, they can also be used for POIs (Points of Interest) and categories:

  • Address: 380 New York St.
  • POI: Starbucks
  • Category: Coffee Shops
A Suggestion result only contains textual display information. To obtain more detailed information, such as geometry, the result can be passed to a geocoding find operation find(LocatorSuggestionResult, int, List, SpatialReference).

Note, this method is currently unsupported for Locators backed by local data. Attempting to call it with a Locator created with createLocalLocator(String) will throw an exception.

Parameters
suggestParams A LocatorSuggestionParameters containing textual input and optional location information.
Returns
Throws
Exception Possible causes of exceptions are: network error, invalid credentials, uninitialized Locator, unsupported operation.