Geocodes a table of addresses.
[Visual Basic .NET] Public Sub MatchTable ( _ ByVal AddressTable As ITable, _ ByVal addressFieldNames As String, _ ByVal whereClause As String, _ ByVal outputFeatureClass As IFeatureClass, _ ByVal outputFieldNames As String, _ ByVal fieldsToCopy As IPropertySet, _ ByVal cancelTracker As ITrackCancel _ )
[C#] public void MatchTable ( ITable AddressTable, string addressFieldNames, string whereClause, IFeatureClass outputFeatureClass, string outputFieldNames, IPropertySet fieldsToCopy, ITrackCancel cancelTracker );
[C++] HRESULT MatchTable( ITable* AddressTable, BSTR addressFieldNames, BSTR whereClause, IFeatureClass* outputFeatureClass, BSTR outputFieldNames, IPropertySet* fieldsToCopy, ITrackCancel* cancelTracker );
AddressTable is a parameter of type ITableaddressFieldNames [in] addressFieldNames is a parameter of type BSTR whereClause [in] whereClause is a parameter of type BSTR outputFeatureClass [in]
outputFeatureClass is a parameter of type IFeatureClassoutputFieldNames [in] outputFieldNames is a parameter of type BSTR fieldsToCopy [in]
fieldsToCopy is a parameter of type IPropertySetcancelTracker [in]
cancelTracker is a parameter of type ITrackCancel
The MatchTable method geocodes a table of addresses to a feature class.
Before you geocode a table of addresses, you must first create the feature class that will contain the geocoded features. In addition to having an ObjectID and the match fields created by the locator, you can also specify fields from the address table to copy to the geocoded feature class. When you geocode a table of addresses using ArcGIS Desktop, the output feature class contains two copies of the address fields from the address table. One copy is a static copy that contains the original values of the address components from the address table. The second copy is an editable copy that you can use to modify the address when rematching the geocoded feature class. The names of the latter set of address fields are prefixed with "ARC_". In general, it is a good idea to follow this pattern when programatically geocoding a table of addresses, since the locator that you attach to the geocoded feature class will then only need to refer to the geocoded feature class itself (and not the original address table) in order to be able to rematch the addresses in the geocoded feature class.
The addressFieldNames parameter is used to specify the names of the fields in the addressTable that contain address information. The field names are contained in a comma-delimited string, in the order required by the address locator. You can get the set of address fields for the geocoding service using IAddressInputs::AddressFields. Use the IField::Required property to determine which address fields are required by the address locator. You must specify the names of the required fields in the address table. If your address table does not contain an optional address field, then do not specify a name in the this property.
The WhereClause parameter is used to restrict which addresses in the table are geocoded using a query.
The outputFeatureClass parameter is the feature class which will contain the geocoded addresses. This feature class must have an ObjectID field, and the match fields for the address locator. Use the MatchFields property to get the match fields for the address locator. In addition to the fields returned from MatchFields property, the result feature class also contains the Match_type field indicating how an adddress was matched. The field may contain the following values assigned by IAddressGeocoding::MatchTable or IAddressUI::RematchTable
- A - Automatically matched or rematched.
- M - If the geocoded feature classes is rematched using the Interactive Rematch dialog box, you may see other values including "M" for manually matched or unmatched using the Match or Unmatch button.
- PP - Pick by Point. The address was matched to the click point using the Pick Address from Map tool in the Interactive Rematch dialog box with ArcMap.
- PA - Pick by Address. That means the address was matched to closest address with the Pick Address from Map tool.
If you want to copy any additional fields from the address table, or create new fields in the feature class, you must also add them to the feature class before geocoding the table.
The outputFieldNames parameter is a string containing a comma-delimited list of the names of the match fields in the feature class. The names of the fields must be specified in the same order as defined by the address locator. Use the MatchFields property to get the match fields for the address locator.
The fieldsToCopy parameter allows you to copy values from fields in the address table to the feature class. To copy a field, add a property to the PropertySet with the name of the destination field in the feature class, and with a value of the name of the field in the address table. You must add the the field to the feature class when you create it in order to copy values from the address table.
The CancelTracker parameter allows you to optionally display the progress while the geocoding service geocodes the table of addresses.
In order to be able to rematch a geocoded feature class, you must attach a locator to the geocoded feature class.
IAddressGeocoding Interface | IAddressGeocoding.MatchAddress Method | IAddressGeocoding.MatchTable Method | IAdvancedGeocoding.RematchTable Method | IAddressGeocoding Interface | ILocatorAttach2.AttachLocator Method | AttachedLocator Class | ILocatorAttach2 Interface | IAttachedLocator Interface | IAddressGeocoding.MatchTable Method | IAttachedLocator Interface | AttachedLocator Class | ILocatorManager2 Interface | ILocatorManager Interface | LocatorManager Class