Geocode Service GeocodeAddresses method
Geocodes multiple addresses and returns a single
match result for each address.
GeocodeAddresses(RecordSet
AddressTable, PropertySet AddressFieldMapping, PropertySet PropMods)
Parameter |
Description |
AddressTable |
A RecordSet containing the addresses to be
geocoded. Each record (row) stores a single address.
The RecordSet must contain a field for each address
field defined by the geocode service and an OID field to store a unique
id.
|
AddressFieldMapping |
Defines the mapping of address fields used
by the geocode service to input fields in the AddressTable RecordSet.
|
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 RecordSet
containing the best match for each input address based on the highest
score. The names of the fields in the RecordSet
are defined by the names of the fields returned by the GetResultFields()
method. If a geocode service finds two or more
matches that have the same highest match score, you can specify whether
or not to match an address arbitrarily using the MatchIfScoresTie property
of the locator. See the PropMods discussion below
for more information on modifying geocode service (locator) properties.
Remarks
The
following diagram illustrates the geocode server proxy methods commonly
used when working with the GeocodeAddresses() method. In
addition, the diagram also includes the input (address) and output (match)
information one can expect when using this method.
The AddressTable parameter is a RecordSet containing the addresses to be
geocoded. To create the RecordSet first create
a RecordSet object and each Field object. A number
of fields must be included. A field named "OID"
must be defined and will be used to store a unique id of each address
match. Also, a field for each address field defined
by the geocode service (returned using the GetAddressFields() method)
must be included. In addition, each Field must
define a value for the Name, Length, and Type properties. To
add an input address to the RecordSet, create a new Record and set the
Values property to an object array of comma delimited values. Add
the fields using the RecordSet.Fields property and add the records using
the RecordSet.Records property.
The AddressFieldMapping parameter defines the mapping of address fields
used by the geocode service to input fields in the AddressTable RecordSet.
The names of the properties in this PropertySet
are the names of the address fields used by the geocode service. Use
the GetAddressFields() method to get the set of fields used by the geocode
service.
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