How To: Attach a locator to a geocoded feature class
When geocoding a table of addresses using ArcObjects, you must attach a locator to the geocoded feature class in order to enable rematching of the addresses in the feature class.
The following steps demonstrate how to correctly attach a locator to a geocoded feature class.
- Geocode the table of addresses using the IAddressGeocoding::MatchTable method. When geocoding the table, copy all the address fields from the address table to the geocoded feature class.
- Obtain a reference to the ILocatorAttach interface on the LocatorWorkspace that contains the locator you used to geocode the addresses.
- Use the ILocatorAttach::AttachLocator method to attach the locator to the geocoded feature class. The AttachToTable, InputTable, and OutputTable parameters should all refer to the geocoded feature class. The InputFieldNames parameter is a string that should contain a comma-delimited list of the field names in the geocoded feature class that contain the address information. The InputJoinFieldName and OutputJoinFieldName parameters are strings that should both contain the name of the ObjectID field in the geocoded feature class.