AutocompleteGeocoderGeocode Method (String, Country, LatLon, TimeSpan, ActionAutocompleteGeocoderPartialResult, AutocompleteGeocoderResultsHint) | |
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release Note: This API is now obsolete.
Generate a set of address suggestions for a specific country, based on a partial address string, optionally ordered by proximity to a
LatLon
location hint.
Namespace:
Telogis.GeoBase.Geocoding
Assembly:
geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax [ObsoleteAttribute("Incremental results callbacks and result hints are deprecated. Use another Geocode method instead.")]
public static AutocompleteGeocoderResult Geocode(
string query,
Country country,
LatLon locationHint,
TimeSpan timeout,
Action<AutocompleteGeocoderPartialResult> incrementalResultsCallback,
AutocompleteGeocoderResultsHint resultsHint
)
<ObsoleteAttribute("Incremental results callbacks and result hints are deprecated. Use another Geocode method instead.")>
Public Shared Function Geocode (
query As String,
country As Country,
locationHint As LatLon,
timeout As TimeSpan,
incrementalResultsCallback As Action(Of AutocompleteGeocoderPartialResult),
resultsHint As AutocompleteGeocoderResultsHint
) As AutocompleteGeocoderResult
Parameters
- query
- Type: SystemString
The partial address string for which to search. - country
- Type: Telogis.GeoBaseCountry
The Country in which to search. - locationHint
- Type: Telogis.GeoBaseLatLon
An optional LatLon value. Suggestions returned by the AutocompleteGeocoder
will be ordered based on their proximity to this location, from nearest to furthest. If you do not wish to use a location hint, this parameter should be set to
Empty. - timeout
- Type: SystemTimeSpan
Specifies how long the search should continue before terminating prematurely. Specifying a timeout of
TimeSpan.Zero means that the search will not timeout. When a search times out, the
AutocompleteGeocoderResult object returned will contain all suggestions found
prior to the timeout, and have a status of Timeout. - incrementalResultsCallback
- Type: SystemActionAutocompleteGeocoderPartialResult
Deprecated. An optional callback to receive incremental results as they are found, in addition to
receiving the full results list on return. - resultsHint
- Type: Telogis.GeoBase.GeocodingAutocompleteGeocoderResultsHint
Deprecated. This parameter will be ignored.
Return Value
Type:
AutocompleteGeocoderResultAn
AutocompleteGeocoderResult object, containing an array of suggestions along with a status code.
Remarks Due to the potential for latency, running this method on a non-UI thread is recommended. See the
Autocomplete Geocoder Tutorial
for an example of a threaded implementation.
Examples AutocompleteGeocoderResult result = AutocompleteGeocoder.Geocode("Rua Treze, Jaguar", Country.Brazil, LatLon.Empty, TimeSpan.FromSeconds(2));
if (result.Status == SearchResult.SearchCompleted && result.Suggestions.Length == 0) {
Console.WriteLine("No results found.");
} else if (result.Status == SearchCancelled) {
Console.WriteLine("Search was canceled.");
} else {
if (result.Status == SearchResult.TooManyResults || result.Status == SearchResult.Timeout) {
Console.WriteLine("Too many results for the string provided. Further qualify the address to see further suggestions.");
} else if (result.Status == SearchResult.SearchCompleted) {
Console.WriteLine("Search completed.");
}
foreach (AutocompleteGeocoderSuggestion suggestion in result.Suggestions) {
Console.WriteLine(suggestion.ToString());
}
}
See Also