Skip to content

GeocodingCloudClient

Namespace: ThinkGeo.Core

A class provides the methods to access the Geocoding APIs.

public class GeocodingCloudClient : CloudClient, System.IDisposable

Inheritance ObjectCloudClientGeocodingCloudClient
Implements IDisposable

Remarks:

A class provides the methods to access the Geocoding APIs.

Properties

TimeoutInSeconds

The request timeout, default 100 seconds

public int TimeoutInSeconds { get; set; }

Property Value

Int32

WebProxy

The proxy used for requesting a Web Response.

public IWebProxy WebProxy { get; set; }

Property Value

IWebProxy

ClientId

A GIS Server NativeConfidential client ID.

public string ClientId { get; set; }

Property Value

String

ClientSecret

A GIS Server NativeConfidential client secret.

public string ClientSecret { get; set; }

Property Value

String

BaseUris

Candidate Gis Server Uris. This collection must have one uri at least before sending any request.

public Collection<Uri> BaseUris { get; }

Property Value

Collection<Uri>

Constructors

GeocodingCloudClient()

Initilizes an instance. You need apply client Id and secret by properties.

public GeocodingCloudClient()

GeocodingCloudClient(String, String)

Initializes an instance with ClientID and ClientSecret. It will send a request to GIS Server to gain the token which will be added to the Header for all the requests.

public GeocodingCloudClient(string clientId, string clientSecret)

Parameters

clientId String
The ClientID for the auth.

clientSecret String
The ClientSecret for the auth.

Exceptions

ArgumentNullException
Thrown when the or is null.

Methods

Search(String)

Search for a location expression

public CloudGeocodingResult Search(string location)

Parameters

location String
The location expression

Returns

CloudGeocodingResult
The search result.

Search(String, CloudGeocodingOptions)

Search for a location expression

public CloudGeocodingResult Search(string location, CloudGeocodingOptions options)

Parameters

location String
The location expression

options CloudGeocodingOptions
The options for the searching.

Returns

CloudGeocodingResult
The search result.

SearchAsync(String)

Search for a location expression

public Task<CloudGeocodingResult> SearchAsync(string location)

Parameters

location String
The location expression

Returns

Task<CloudGeocodingResult>
The search result.

SearchAsync(String, CloudGeocodingOptions)

Search for a location expression

public Task<CloudGeocodingResult> SearchAsync(string location, CloudGeocodingOptions options)

Parameters

location String
The location expression

options CloudGeocodingOptions
The options for the searching.

Returns

Task<CloudGeocodingResult>
The search result.

Search(IEnumerable<String>)

Search for multi locations

public Collection<CloudGeocodingResult> Search(IEnumerable<string> locations)

Parameters

locations IEnumerable<String>
The multi location

Returns

Collection<CloudGeocodingResult>
The search result.

Search(IEnumerable<String>, CloudGeocodingOptions)

Search for multi locations

public Collection<CloudGeocodingResult> Search(IEnumerable<string> locations, CloudGeocodingOptions options)

Parameters

locations IEnumerable<String>
The multi location

options CloudGeocodingOptions
The options for the searching.

Returns

Collection<CloudGeocodingResult>
The search result.

SearchAsync(IEnumerable<String>)

Search for multi locations

public Task<Collection<CloudGeocodingResult>> SearchAsync(IEnumerable<string> locations)

Parameters

locations IEnumerable<String>
The multi location

Returns

Task<Collection<CloudGeocodingResult>>
The search result.

SearchAsync(IEnumerable<String>, CloudGeocodingOptions)

Search for multi locations

public Task<Collection<CloudGeocodingResult>> SearchAsync(IEnumerable<string> locations, CloudGeocodingOptions options)

Parameters

locations IEnumerable<String>
The multi location

options CloudGeocodingOptions
The options for the searching.

Returns

Task<Collection<CloudGeocodingResult>>
The search result.

Events

GettingAccessToken

Occurs before getting an AccessToken.

public event EventHandler<GettingAccessTokenEventArgs> GettingAccessToken;

SendingWebRequest

Occurs before sending a web request.

public event EventHandler<SendingWebRequestEventArgs> SendingWebRequest;

SentWebRequest

Occurs after the response of a web request is gotten.

public event EventHandler<SentWebRequestEventArgs> SentWebRequest;