|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.location.GeocodeServer
public class GeocodeServer
A class that provides geocoding as a service.
A GeocodeServer object uses an address locator to provide coarse-grained geocoding functionality either in Desktop and Engine applications, or using ArcGIS Server over the network. In a Desktop or Engine environment, developers can use the GeocodeServer to perform coarse-grained geocoding tasks, such as geocoding a table of addresses, more easily than with the finer-grained geocoding ArcObjects. In an ArcGIS Server environment, GeocodeServer objects can be accessed over the network to provide geocoding functionality hosted by a remote server.
All of the coarse-grained functionality of the GeocodeServer can be accessed through the IGeocodeServer interface. Using this interface, you can geocode single addresses, geocode tables of addresses, find the address closest to a point, and access all of the support functionality required to accomplish these tasks.
In order to access the fine-grained ArcObjects that support the geocoding functionality of the GeocodeServer, use the IGeocodeServerObjects to obtain a reference to the address locator on which the GeocodeServer is based. From this address locator, developers can access all of the fine-grained ArcObjects associated with the address locator, such as the reference data used by the address locator. Note that the fine-grained objects that support the GeocodeServer are stateful, and so you should only use a non-pooled GeocodeServer when modifying these objects.
For more information on accessing ArcGIS Server objects in stateful and stateless applications, refer to the ArcGIS Server Administrator and Developer Guide.
Field Summary |
---|
Fields inherited from interface com.esri.arcgis.system.IRequestHandler |
---|
IID, IID46a0e2ea_3b64_4a46_bd78_88a1660f35bb, xxDummy |
Constructor Summary | |
---|---|
GeocodeServer()
Constructs a GeocodeServer using ArcGIS Engine. |
|
GeocodeServer(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. GeocodeServer theGeocodeServer = (GeocodeServer) obj; |
Method Summary | |
---|---|
void |
attachToLocator(ILocatorName locName)
Attach this service to the locator specified by the locator name. |
void |
construct(IPropertySet props)
Two phase object construction. |
boolean |
equals(Object o)
Compare this object with another |
IRecordSet |
findAddressCandidates(IPropertySet address,
IPropertySet propMods)
Generates candidates for an address (normal or standardized form). |
IServerObjectExtension |
findExtensionByCLSID(String cLSID)
Returns a server object extension found using a string representation of its class ID. |
IServerObjectExtension |
findExtensionByTypeName(String name)
Returns a server object extension found using its type name. |
IPropertySet |
geocodeAddress(IPropertySet address,
IPropertySet propMods)
Geocodes a single address (normal or standardized form). |
IRecordSet |
geocodeAddresses(IRecordSet addressTable,
IPropertySet addressFieldMapping,
IPropertySet propMods)
Geocodes a table of addresses. |
IFields |
getAddressFields()
Fields needed to geocode a table of addresses. |
ILocator |
getAddressLocator()
The address locator used by the geocode server. |
String |
getAdjustableProperties()
The list of properties (comma delimited) that can be modified at runtime (for a given method). |
IFields |
getCandidateFields(IPropertySet propMods)
Fields contained in a list of candidates. |
static String |
getClsid()
getClsid. |
String |
getConfigurationName()
Name of the server object configuration that defines the server object. |
IPropertySet |
getDefaultInputFieldMapping()
Suggested field name mappings for all input fields. |
Object |
getDefaultInputFieldNames()
Recognized names for the single line input field. |
IFields |
getIntersectionCandidateFields(IPropertySet propMods)
Fields contained by intersection candidates. |
IPropertySet |
getLocatorProperties()
Default properties for a locator. |
IFields |
getResultFields(IPropertySet propMods)
Fields contained in the geocoding result. |
IField |
getSingleLineAddressField()
Field needed to geocode a single line address. |
IFields |
getStandardizedFields()
Fields contained in a standardized address. |
IFields |
getStandardizedIntersectionFields()
Fields contained in a standardized intersection. |
int |
getSuggestedBatchSize()
The suggested number of addresses to send to a server in one batch request. |
String |
getTypeName()
Type of the server object (MapServer or GeocodeServer). |
byte[] |
handleBinaryRequest(byte[] request)
Handles a binary request. |
byte[] |
handleBinaryRequest2(String capabilities,
byte[] request)
Handles a binary request with explicit capabilities. |
String |
handleStringRequest(String capabilities,
String request)
Handles a SOAP string request. |
int |
hashCode()
the hashcode for this object |
IPropertySet |
reverseGeocode(IPoint location,
boolean bReturnIntersection,
IPropertySet propMods)
Generates an address for a point. |
void |
setAdjustableProperties(String propertyList)
The list of properties (comma delimited) that can be modified at runtime (for a given method). |
void |
setSuggestedBatchSize(int size)
The suggested number of addresses to send to a server in one batch request. |
IPropertySet |
standardizeAddress(IPropertySet address,
IPropertySet propMods)
Standardizes an address. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public GeocodeServer() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic GeocodeServer(Object obj) throws IOException
GeocodeServer theGeocodeServer = (GeocodeServer) obj;
obj
to GeocodeServer
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void construct(IPropertySet props) throws IOException, AutomationException
construct
in interface IObjectConstruct
props
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public byte[] handleBinaryRequest(byte[] request) throws IOException, AutomationException
handleBinaryRequest
in interface IRequestHandler
request
- An unsigned byte (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String handleStringRequest(String capabilities, String request) throws IOException, AutomationException
handleStringRequest
in interface IRequestHandler
capabilities
- The capabilities (in)request
- The request (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public byte[] handleBinaryRequest2(String capabilities, byte[] request) throws IOException, AutomationException
handleBinaryRequest2
in interface IRequestHandler2
capabilities
- The capabilities (in)request
- An unsigned byte (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IPropertySet geocodeAddress(IPropertySet address, IPropertySet propMods) throws IOException, AutomationException
The GeocodeAddress method geocodes a single address defined by the address PropertySet, and returns a PropertySet containing the match property values.
The address parameter is a PropertySet containing the address to be geocoded. The names of the properties in this PropertySet are the names of the address fields used by the GeocodeServer. The most common way to geocode an address using the GeocodeAddress method is to allow the GeocodeServer to standardize the address before searching for a match for the address. In this case, use the GetAddressFields method to retrieve the definitions of the address fields used by the GeocodeServer, and use the names of these fields as the names of the properties defined in the address PropertySet. The Required property on each Field object indicates whether the address field is required by the GeocodeServer. Failing to specify a required address property results in an error.
In some cases, you may want to geocode an address that has been standardized with the input of the user or through some other method. In these cases, use the GetStandardizedFields or GetStandardizedIntersectionFields methods to retrieve the names of the standardized address fields used by the GeocodeServer , and use the names of these fields as the names of the properties defined in the address PropertySet. You must also add an additional property to the address PropertySet to indicate that the address is a standardized address. The name of this property must be "ADDR_TYPE", and its value must be "A" for a standardized address, or "I" for a standardized intersection.
The propMods parameter is a PropertySet containing the GeocodeServer properties to use to geocode the address. The GetLocatorProperties method returns the set of default geocoding properties for the GeocodeServer. In some cases, you may want to modify the geocoding properties used to geocode an address. For example, you may wish to change the spelling sensitivity used to search for a match for the address, or you may want to change the side and end offset applied to the geocoded location. Modify the properties in the PropertySet returned by the GetLocatorProperties method, and pass the modified PropertySet to the propMods parameter. The PropertySet passed to the propMods parameter only needs to contain properties that are different than the default properties for the GeocodeServer. If you don't wish to modify any of the default properties returned used by the GeocodeServer, you can either pass a null value to the propMods parameter, or pass the unmodified PropertySet returned by the GetLocatorProperties method.
The GeocodeAddress method returns a PropertySet that contains a set of properties that define the match found by the GeocodeServer . The names of these properties are defined by the names of the Field objects returned by the GetResultFields method.
geocodeAddress
in interface IGeocodeServer
address
- A reference to a com.esri.arcgis.system.IPropertySet (in)propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IRecordSet geocodeAddresses(IRecordSet addressTable, IPropertySet addressFieldMapping, IPropertySet propMods) throws IOException, AutomationException
The GeocodeAddresses method geocodes a RecordSet of addresses, and returns a RecordSet containing the match properties for each address.
The AddressTable parameter is a RecordSet containing the addresses to be geocoded. To create the RecordSet, first co-create a RecordSet coclass, then use the IRecordSetInit::SetSourceTable method set a reference to the table that contains the addresses to geocode. In order to reduce the amount of data that needs to be sent to the server, use the pFilter parameter on the IRecordSetInit::SetSourceTable method to define a QueryFilter that includes only the ObjectID and address fields from the address table.
The addressFieldMapping parameter defines the mapping of address fields used by the GeocodeServer to fields in the AddressTable RecordSet. The names of the properties in this PropertySet are the names of the address fields used by the GeocodeServer. Use the GetAddressFields method to get the set of fields used by the GeocodeServer. The values of the properties are the names of the corresponding fields in the RecordSet.
The propMods parameter is a PropertySet containing the GeocodeServer properties to use to geocode the address. The GetLocatorProperties method returns the set of default geocoding properties for the GeocodeServer. In some cases, you may want to modify the geocoding properties used to geocode addresses. For example, you may wish to change the spelling sensitivity used to search for matches for addresses, or you may want to change the side and end offset applied to the geocoded locations. Modify the properties in the PropertySet returned by the GetLocatorProperties method, and pass the modified PropertySet to the propMods parameter. The PropertySet passed to the propMods parameter only needs to contain properties that are different than the default properties for the GeocodeServer. If you don't wish to modify any of the default properties returned used by the GeocodeServer, you can either pass a null value to the propMods parameter, or pass the unmodified PropertySet returned by the GetLocatorProperties method.
Note that, when passing objects as parameters to any member of the IGeocodeServer interface, all of the objects should be created from within the server context. Objects are created within a server context if they are retrieved from the ServerContext object corresponding to the GeocodeServer, of if they are created by other objects that belong to the server context.
geocodeAddresses
in interface IGeocodeServer
addressTable
- A reference to a com.esri.arcgis.geodatabase.IRecordSet (in)addressFieldMapping
- A reference to a com.esri.arcgis.system.IPropertySet (in)propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IPropertySet standardizeAddress(IPropertySet address, IPropertySet propMods) throws IOException, AutomationException
The StandardizeAddress method standardizes an address using the geocoding rules used by the GeocodeServer.
The address parameter is a PropertySet that contains the address to standardize. The names of the properties are the input address fields used by the GeocodeServer, as defined by the GetAddressFields method.
The propMods parameter is a PropertySet containing the GeocodeServer properties to use to standardize the address. The GetLocatorProperties method returns the set of default geocoding properties for the GeocodeServer. In some cases, you may want to modify the properties used to standardize an address. Modify the properties in the PropertySet returned by the GetLocatorProperties method, and pass the modified PropertySet to the propMods parameter. The PropertySet passed to the propMods parameter only needs to contain properties that are different than the default properties for the GeocodeServer. If you don't wish to modify any of the default properties returned used by the GeocodeServer, you can either pass a null value to the propMods parameter, or pass the unmodified PropertySet returned by the GetLocatorPropertiesmethod.
The PropertySet returned by the StandardizeAddress method contains the standardized address. In addition to the standardized address components, this PropertySet contains a property named "Addr_type" that indicates the type of address. If the value of this property is "A", then the address was standardized as a non-intersection address. If the value of this property is "I", then the address was standardized as an intersection address. The set of remaining properties will depend on the value of this property. If the standardized address returned is a non-intersection address, then use the names of the fields returned by the GetStandardizedFields method to retrieve the components of the standardized address. If the standardized address returned is an intersection address, then use the names of the fields returned by the GetStandardizedIntersectionFields method to retrieve the components of the standardized address.
standardizeAddress
in interface IGeocodeServer
address
- A reference to a com.esri.arcgis.system.IPropertySet (in)propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IRecordSet findAddressCandidates(IPropertySet address, IPropertySet propMods) throws IOException, AutomationException
The FindAddressCandidates method finds candidates for a single address defined by the address PropertySet, and returns a Recordset containing the candidates.
The address parameter is a PropertySet containing the address for which to find candidates. The names of the properties in this PropertySet are the names of the address fields used by the GeocodeServer. The most common way to find candidates for an address using the FindAddressCandidates method is to allow the GeocodeServer to standardize the address before searching for candidates for the address. In this case, use the GetAddressFields method to retrieve the definitions of the address fields used by the GeocodeServer, and use the names of these fields as the names of the properties defined in the address PropertySet. The Required property on each Field object indicates whether the address field is required by the GeocodeServer. Failing to specify a required address property results in an error.
In some cases, you may want to geocode an address that has been standardized with the input of the user or through some other method. In these cases, use the GetStandardizedFields or GetStandardizedIntersectionFields methods to retrieve the names of the standardized address fields used by the GeocodeServer , and use the names of these fields as the names of the properties defined in the address PropertySet. You must also add an additional property to the address PropertySet to indicate that the address is a standardized address. The name of this property must be "ADDR_TYPE", and its value must be "A" for a standardized address, or "I" for a standardized intersection.
The propMods parameter is a PropertySet containing the GeocodeServer properties to use to find candidates for the address. The GetLocatorProperties method returns the set of default geocoding properties for the GeocodeServer. In some cases, you may want to modify the geocoding properties used to find candidates for an address. For example, you may wish to change the spelling sensitivity used to search for candidates for the address, or you may want to change the side and end offset applied to the candidate locations. Modify the properties in the PropertySet returned by the GetLocatorProperties method, and pass the modified PropertySet to the propMods parameter. The PropertySet passed to the propMods parameter only needs to contain properties that are different than the default properties for the GeocodeServer. If you don't wish to modify any of the default properties returned used by the GeocodeServer, you can either pass a null value to the propMods parameter, or pass the unmodified PropertySet returned by the GetLocatorProperties method.
The FindAddressCandidates method returns a Recordset that contains Rows that define candidates for the address found by the GeocodeServer. For non-intersection addresses, use the GetCandidateFields method to get the set of fields contained in the Recordset. For intersection addresses, use the GetIntersectionCandidateFields method to get the set of fields contained in the Recordset.
findAddressCandidates
in interface IGeocodeServer
address
- A reference to a com.esri.arcgis.system.IPropertySet (in)propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFields getAddressFields() throws IOException, AutomationException
The GetAddressFields method returns a Fields object containing the input address fields used by the GeocodeServer. The IField::Required property on each Field object indicates if the GeocodeServer requires this field when geocoding addresses.
getAddressFields
in interface IGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFields getCandidateFields(IPropertySet propMods) throws IOException, AutomationException
The GetCandidateFields object returns a Fields object that contains definitions of the Fields in the Recordset returned by the FindAddressCandidates method for non-intersection addresses.
getCandidateFields
in interface IGeocodeServer
propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFields getIntersectionCandidateFields(IPropertySet propMods) throws IOException, AutomationException
The GetIntersectionCandidateFields object returns a Fields object that contains definitions of the Fields in the Recordset returned by the FindAddressCandidates method for intersection addresses.
getIntersectionCandidateFields
in interface IGeocodeServer
propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFields getStandardizedFields() throws IOException, AutomationException
The GetStandardizedFields method returns a set of fields that define the elements of a standardized non-intersection address. Use this method when constructing a PropertySet that represents a standardized address to pass to the GeocodeAddress or FindAddressCandidates methods, and when inspecting an address that has been standardized using the StandardizeAddress method.
getStandardizedFields
in interface IGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFields getStandardizedIntersectionFields() throws IOException, AutomationException
The GetStandardizedIntersectionFields method returns a set of fields that define the elements of a standardized intersection address. Use this method when constructing a PropertySet that represents a standardized address to pass to the GeocodeAddress or FindAddressCandidates methods, and when inspecting an address that has been standardized using the StandardizeAddress method.
getStandardizedIntersectionFields
in interface IGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IFields getResultFields(IPropertySet propMods) throws IOException, AutomationException
The GetResultFields property returns a Fields object that defines the fields returned by the address locator on which the GeocodeServer is based. For more information on the fields returned by address locators, see IAddressGeocoding::MatchFields.
getResultFields
in interface IGeocodeServer
propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IAddressGeocoding.getMatchFields()
public IPropertySet getDefaultInputFieldMapping() throws IOException, AutomationException
The GetDefaultInputFieldMapping property returns suggested names for fields in an address table that map to input address fields used by the GeocodeServer. Use this method when preparing a table for the GeocodeAddresses method to automatically detect the fields in the address table that contain address information.
The names of the properties contained in the PropertySet returned by this method are the names of the input address fields. Use the GetAddressFields method to get the names of the input address fields used by the GeocodeServer. The value of each property is a comma-delimited list of suggested field names for each input address field.
getDefaultInputFieldMapping
in interface IGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IPropertySet getLocatorProperties() throws IOException, AutomationException
The GetLocatorProperties method returns a PropertySet containing all of the geocoding properties used by the GeocodeServer. To change the geocoding properties used when calling other methods on the IGeocodeServer interface, modify the properties in this PropertySet, then pass the PropertySet to the method you are calling using the propMods parameter on the method.
The following table describes all
of the properties that might be contained in the PropertySet
returned by the GetLocatorProperties method:
Name | Description | Values |
---|---|---|
EndOffset | The end offset used by the address locator. | A long integer value between 0 and 50 |
IntersectionConnectors | The intersection connectors used by the address locator. | A string value containing the space-delimited list of intersection connectors (e.g., "| & @") |
MatchIfScoresTie | Indicates if the GeocodeServer should match an addresses to a candidate if two or more candidates share the same best candidate score. | "TRUE" or "FALSE" |
MinimumCandidateScore | The minimum candidate score used by the address locator. | A long integer value between 0 and 100 |
MinimumMatchScore | The minimum match score used by the address locator. | A long integer value between 0 and 100 |
ReverseDistance | The search distance to use to search for reference data features when reverse geocoding. The ReverseDistance value is specified in the reverse distance units used by the address locator. | A double floating-point value |
ReverseDistanceUnits | The search distance units used by the address locator when reverse geocoding. Valid values include all of the enumeration constant names included in the esriUnits enumeration, without the "esri" prefix (e.g., "Meters"). | A string representing the reverse geocoding distance units |
SideOffset | The side offset used by the address locator. The SideOffset value is specified in the side offset units used by the address locator. | A double floating-point value |
SideOffsetUnits | The side offset units used by the address locator. Valid values include all of the enumeration constant names included in the esriUnits enumeration, without the "esri" prefix (e.g., "Meters"). | A string representing the side offset units |
SpellingSensitivity | The spelling sensitivity used by the address locator. | A long integer value between 0 and 100 |
SuggestedBatchSize | The batch size to use when batch geocoding a table of addresses. Refer to the ArcGIS Server Administrator and Developer Guide for more information on the suggested batch size. | A long integer value |
UICLSID | The Class ID of the LocatorUI object to use for the GeocodeServer's user interface in desktop applications. | A string value containing the CLSID |
For more information on the properties listed above, please refer to the IGeocodingProperties interface.
getLocatorProperties
in interface IGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IPropertySet reverseGeocode(IPoint location, boolean bReturnIntersection, IPropertySet propMods) throws IOException, AutomationException
The ReverseGeocode method returns the address closest to the given point, and within a specified search distance.
The location parameter is a Point object that represents the point at which to search for the closest address. Note that the Point passed to this parameter have the same spatial reference as the GeocodeServer's output. The easiest way to get the spatial reference from the GeocodeServer is to use the GetResultFields method to get the result Fields, and then get the spatial reference from the shape field's GeometryDef object. If the Point is in some other spatial reference (such as a point feature from another feature class), then you must first project the point into the GeocodeServer's output spatial reference. This is most easily done using the IPoint::Project method.
The bReturnIntersection parameter indicates whether the GeocodeServer should return the nearest intersection to the given point. If the value of this parameter is True, then the GeocodeServer will return the nearest intersection to the given point, provided that the GeocodeServer supports intersection geocoding, and provided that there is an intersection within the reverse geocoding search distance. If the value of this parameter is False, then the GeocodeServer will return the nearest address to the given point, provided that there is an address within the GeocodeServer 's reverse geocoding search tolerance.
The propMods parameter is a PropertySet containing the geocoding properties to use for reverse geocoding. There are two properties that are relevant to reverse geocoding. The ReverseDistance and ReverseDistanceUnits properties specify the distance from the given point to which to search for addresses. When specifying the ReverseDistanceUnits property, use a string to indicate the units to use. For example, when searching for an address using a search distance specified in esriMeters, use the string "Meters" to specify the search distance units. Refer to the esriUnits enumeration for a list of all supported search distance units.
The PropertySet returned by the ReverseGeocode method contains properties that describe the address. The names of the properties are the names of the Fields returned by the GetAddressFields method, and their values correspond to the components of the nearest address. In fact, the PropertySet returned by the ReverseGeocode method could be passed to the GeocodeAddress method to get the geometry of the closest address to the given point.
reverseGeocode
in interface IGeocodeServer
location
- A reference to a com.esri.arcgis.geometry.IPoint (in)bReturnIntersection
- The bReturnIntersection (in)propMods
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ILocator getAddressLocator() throws IOException, AutomationException
This IGeocodeServerObjects interface is available only if the GeocodeServer was obtained for use in a stateful manner (i.e., either by co-creating the GeocodeServer object or by obtaining a reference using a GISServerConnection object.)
The following example illustrates how to obtain a reference to the address locator that provides the geocoding functionality for a GeocodeServer:
Dim pGISServerConnection As esriServer.IGISServerConnection
Dim pServerObjectManager As esriServer.IServerObjectManager
Dim pServerContext As esriServer.IServerContext
Dim pGeocodeServerObjects As esriLocation.IGeocodeServerObjects
Dim pLocator As esriGeoDatabase.ILocator
'+++ connect to an ArcGIS Server and get the server object manager
Set pGISServerConnection = New esriServer.GISServerConnection
pGISServerConnection.Connect ("napanee")
Set pServerObjectManager = pGISServerConnection.ServerObjectManager
'+++ get a GeocodeServer object from its server context
Set pServerContext = pServerObjectManager.CreateServerContext("RedlandsStreets", "GeocodeServer")
Set pGeocodeServerObjects = pServerContext.ServerObject
'+++ get the address locator from the GeocodeServer
Set pLocator = pGeocodeServerObjects.AddressLocator
'+++ release the server context after completing work with the GeocodeServer
pServerContext.ReleaseContext
getAddressLocator
in interface IGeocodeServerObjects
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IField getSingleLineAddressField() throws IOException, AutomationException
getSingleLineAddressField
in interface IGeocodeServerSingleLine
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getDefaultInputFieldNames() throws IOException, AutomationException
getDefaultInputFieldNames
in interface IGeocodeServerSingleLine
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void attachToLocator(ILocatorName locName) throws IOException, AutomationException
To create a new GeocodeServer in a Desktop or Engine environment, simply create a new GeocodeServer object and attach the address locator on which you want to base the GeocodeServer using the AttachToLocator method.
Dim pLocatorManager As esriLocation.ILocatorManager
Dim pLocatorWorkspace As esriGeoDatabase.ILocatorWorkspace
Dim pLocatorName As esriGeoDatabase.ILocatorName
Dim pInitGeocodeServer As esriLocation.IInitGeocodeServer
'+++ get a reference to the locator on which to base the GeocodeServer
Set pLocatorManager = New esriLocation.LocatorManager
Set pLocatorWorkspace = _
pLocatorManager.GetLocatorWorkspaceFromPath("D:\Workspace\ArcGIS Developer Help\GeocodeServer")
Set pLocatorName = pLocatorWorkspace.GetLocatorName("Redlands Streets")
'+++ create a new GeocodeServer
Set pInitGeocodeServer = New esriLocation.GeocodeServer
pInitGeocodeServer.AttachToLocator pLocatorName
attachToLocator
in interface IInitGeocodeServer
locName
- A reference to a com.esri.arcgis.geodatabase.ILocatorName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getAdjustableProperties() throws IOException, AutomationException
The IInitGeocodeServer interface is available only if the GeocodeServer was obtained for use in a stateful manner (i.e., either by co-creating the GeocodeServer object or by obtaining a reference using a GISServerConnection object.)
The AdjustableProperties method returns a comma-delimited string containing the list of properties that a user or developer can modify at runtime when using a GeocodeServer. Use this method to inspect and restrict the set of properties that users and developers can modify. Refer to the IGeocodeServer::GetLocatorProperties method for a list of property names that can be used.
The following example illustrates how to modify the set of adjustable properties so that users and developers cannot change the minimum candidate score used by the GeocodeServer at runtime:
Public Sub SetAdjustableProperties()
Dim pGISServerConnection As esriServer.IGISServerConnection
Dim pServerObjectManager As esriServer.IServerObjectManager
Dim pServerContext As esriServer.IServerContext
Dim pInitGeocodeServer As esriLocation.IInitGeocodeServer
Dim varAdjustableProperties As Variant
Dim strAdjustableProperties() As String
Dim lngPropertyIndex As Long
On Error GoTo ErrorHandler
'+++ connect to an ArcGIS Server and get the server object manager
Set pGISServerConnection = New esriServer.GISServerConnection
pGISServerConnection.Connect ("napanee")
Set pServerObjectManager = pGISServerConnection.ServerObjectManager
'+++ get a GeocodeServer object from its server context
Set pServerContext = pServerObjectManager.CreateServerContext("RedlandsStreets", "GeocodeServer")
Set pInitGeocodeServer = pServerContext.ServerObject
'+++ get the set of adjustable properties and remove the minimum candidate score
varAdjustableProperties = Split(pInitGeocodeServer.AdjustableProperties, ",")
For lngPropertyIndex = LBound(varAdjustableProperties) To UBound(varAdjustableProperties)
If varAdjustableProperties(lngPropertyIndex) <> "MinimumCandidateScore" Then
ReDim Preserve strAdjustableProperties(0 To UBound(strAdjustableProperties) + 1)
strAdjustableProperties(UBound(strAdjustableProperties)) = _
varAdjustableProperties(lngPropertyIndex)
End If
Next lngPropertyIndex
pInitGeocodeServer.AdjustableProperties = Join(strAdjustableProperties, ",")
'+++ release the server context after completing work with the GeocodeServer
pServerContext.ReleaseContext
Exit Sub
ErrorHandler:
If Err.Number = 9 Then '+++ subscript out of range error
ReDim strAdjustableProperties(0 To 0)
Resume Next
End If
End Sub
getAdjustableProperties
in interface IInitGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setAdjustableProperties(String propertyList) throws IOException, AutomationException
setAdjustableProperties
in interface IInitGeocodeServer
propertyList
- The propertyList (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getSuggestedBatchSize() throws IOException, AutomationException
Refer to the ArcGIS Server Administrator and Developer Guide for more information on the suggested batch size.
getSuggestedBatchSize
in interface IInitGeocodeServer
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSuggestedBatchSize(int size) throws IOException, AutomationException
setSuggestedBatchSize
in interface IInitGeocodeServer
size
- The size (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getConfigurationName() throws IOException, AutomationException
getConfigurationName
in interface IServerObject
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getTypeName() throws IOException, AutomationException
getTypeName
in interface IServerObject
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IServerObjectExtension findExtensionByCLSID(String cLSID) throws IOException, AutomationException
findExtensionByCLSID
in interface IServerObjectExtensionManager
cLSID
- The cLSID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IServerObjectExtension findExtensionByTypeName(String name) throws IOException, AutomationException
findExtensionByTypeName
in interface IServerObjectExtensionManager
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |