Geocode Service GeocodeAddress method
Geocodes a single address and returns a single
result.
GeocodeAddress(PropertySet
Address, PropertySet PropMods)
Parameter |
Description |
Address
|
Address information stored as a PropertySet
to be geocoded. Each property is associated with
an address field defined for the geocoding service. Use
GetAddressFields() to get a list of fields.
|
PropMods
|
Modifications to the geocode service properties.
Use GetLocatorProperties() to get a list of default
locator properties.
Use GetLocatorProperties()
to return default locator properties.
|
Return Value
A PropertySet
containing property-values pairs defining the best match found by the
geocode service. The names of these properties
are defined by the names of the Field objects returned by the GetResultFields()
method.
Remarks
The
following diagram illustrates the geocode server proxy methods commonly
used when working with the GeocodeAddress() method. In
addition, the diagram also includes the input (address) and output (match)
information one can expect when using this method.
The input Address parameter is a PropertySet containing the address to
geocode and find the best match. The names of the
properties in this PropertySet are the names of the address fields used
by the geocode service. The most common way to find candidates for an
address using the FindAddressCandidates() method is to allow the geocode
service to standardize the address before searching for candidates. In
this case, use the GetAddressFields() method to retrieve the definitions
of the address fields used by the geocode service, and use the names of
these fields as the names of the properties defined in the address PropertySet.
Each Field object has a Required property which
indicates if the address field is required by the geocode service. Failing
to specify a required address property will return an error.
In some cases you may want to geocode an address that has already been
standardized (thus the geocode service will not standardize any address
input). Use the GetStandardizedFields() or GetStandardizedIntersectionFields()
methods to retrieve the names of the standardized address fields used
by the geocode service, 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 PropertySet
only needs to contain properties that have a value, even if the standardized
field is listed as required.
The PropMods parameter is a PropertySet containing the geocode service
properties to use to find candidates for the address. The GetLocatorProperties()
method returns the set of default geocoding properties for the geocode
service. In some cases, you may want to modify the geocoding properties
used to determine the best location for 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 as the PropMods parameter. The
PropertySet only needs to contain properties that are different than the
default properties for the geocode service. If
you do not need to modify any of the default properties returned used
by the geocode service, the PropMods parameter can be null or you can
pass the unmodified PropertySet returned by the GetLocatorProperties()
method.
Examples