com.esri.core.tasks.bing.geocode
Class BingLocator

java.lang.Object
  extended by com.esri.core.tasks.bing.geocode.BingLocator

public class BingLocator
extends Object

Class representing a Bing Maps geocoder.
The default url used to access the Bing Maps Locations service is "http://dev.virtualearth.net/REST/v1/Locations"


Constructor Summary
BingLocator(String appId)
          Constructor taking the application ID or Bing Maps key as a parameter
 
Method Summary
 Response<BingLocatorResult> geocode(BingAddress bingAddress)
          Sends a geocode request to Bing Maps to find location candidates for the address specified.
 Response<BingLocatorResult> geocode(BingAddress bingAddress, int outSR)
          Sends a geocode request to Bing Maps to find location candidates for the address specified and returns the location candidates in the spatial reference provided.
 String getAppId()
          Returns the appID
 String getCulture()
          Returns the culture
 String[] getIncludeEntityTypes()
          Returns the entity types to be included in the response
 String getUrl()
          Returns the url to the Bing Maps Locations service
 String getVersion()
          Returns the version of the Bing Maps Locations service
 Response<BingLocatorResult> reverseGeocode(Point point)
          Sends a reverse-geocode request to Bing Maps to find address candidates for the location specified.
 Response<BingLocatorResult> reverseGeocode(Point point, int inSR, int outSR)
           Sends a reverse-geocode request to Bing Maps to find address candidates for the location specified.
 void setCulture(String culture)
           Sets the culture to be used by the response
 void setIncludeEntityTypes(String[] includeEntityTypes)
          Sets the entity types to be included in the response
 void setUrl(String url)
          Sets the url to the Bing Maps Locations service
 void setVersion(String version)
          Sets the version of the Bing Maps Locations service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BingLocator

public BingLocator(String appId)
Constructor taking the application ID or Bing Maps key as a parameter

Parameters:
appId - the application ID or Bing Maps key
Method Detail

getCulture

public String getCulture()
Returns the culture

Returns:
the culture

getAppId

public String getAppId()
Returns the appID

Returns:
the appID

getVersion

public String getVersion()
Returns the version of the Bing Maps Locations service

Returns:
the version

getIncludeEntityTypes

public String[] getIncludeEntityTypes()
Returns the entity types to be included in the response

Returns:
the includeEntityTypes

setIncludeEntityTypes

public void setIncludeEntityTypes(String[] includeEntityTypes)
Sets the entity types to be included in the response

Parameters:
includeEntityTypes - the includeEntityTypes to set

setVersion

public void setVersion(String version)
Sets the version of the Bing Maps Locations service

Parameters:
version - the version to set

setCulture

public void setCulture(String culture)

Sets the culture to be used by the response

Please refer to this page for more information: http://msdn.microsoft.com/en-us/library/ff701709.aspx

Parameters:
culture - the culture to set

getUrl

public String getUrl()
Returns the url to the Bing Maps Locations service

Returns:
the url to the Bing Maps Locations service

setUrl

public void setUrl(String url)
Sets the url to the Bing Maps Locations service

Parameters:
url - the url to the Bing Maps Locations service

geocode

public Response<BingLocatorResult> geocode(BingAddress bingAddress)
                                    throws Exception
Sends a geocode request to Bing Maps to find location candidates for the address specified.

Parameters:
bingAddress - the address to be geocoded
Returns:
a Bing Maps response containing the results of the address geocoding
Throws:
Exception

geocode

public Response<BingLocatorResult> geocode(BingAddress bingAddress,
                                           int outSR)
                                    throws Exception
Sends a geocode request to Bing Maps to find location candidates for the address specified and returns the location candidates in the spatial reference provided.

Parameters:
bingAddress - the address to be geocoded
outSR - the Well-known ID (WKID) of the output spatial reference
Returns:
a Bing Maps response containing the results of the address geocoding
Throws:
Exception

reverseGeocode

public Response<BingLocatorResult> reverseGeocode(Point point)
                                           throws Exception
Sends a reverse-geocode request to Bing Maps to find address candidates for the location specified.

Parameters:
point - the location to be reverse-geocoded
Returns:
a Bing Maps response containing the results of the location reverse-geocoding
Throws:
Exception

reverseGeocode

public Response<BingLocatorResult> reverseGeocode(Point point,
                                                  int inSR,
                                                  int outSR)
                                           throws Exception

Sends a reverse-geocode request to Bing Maps to find address candidates for the location specified.

The location coordinates to be geocoded are expected to be in the input spatial reference provided unless -1 is provided: the service would in that case use the default spatial reference WGS1984 (WKID=4326)

The address candidates locations will be returned in the output spatial reference provided, unless -1 is provided: in that case, locations would be returned in the Bing Maps default spatial reference WGS 1984 (WKID=4326)

Parameters:
point - the location to be reverse-geocoded
inSR - the Well-known ID (WKID) of the input spatial reference
outSR - the Well-known ID (WKID) of the output spatial reference
Returns:
a Bing Maps response containing the results of the location reverse-geocoding
Throws:
Exception


Copyright © 2010. All Rights Reserved.