Standardizing an address
Locators and locator styles support the
ISimpleStandardization interface, which can be used to standardize single addresses or tables and feature classes containing address information. The most common usage for this interface is to use the
SimpleStandardizeTable method to standardize the address information in a feature class that will be used as reference data for a locator.
It is a good idea to standardize the address information in reference data feature classes so that address locators that were created using those reference data feature classes standardize addresses in the same way that they are standardized in the reference data.
The
InputTable parameter is a reference to the table or feature class containing the address information that you want to standardize.
The inputFieldsToConcatenate parameter is a comma-delimited string containing the names of the fields in the input dataset that when concatenated, form an address that can be standardized.
This set of field names should include a numeric field that can represent a house number.
Standardizing a dataset
When standardizing a dataset, you must first create the table or feature class that contains the standardized records and pass it to the SimpleStandardizeTable method using the
OutputTable parameter. At a minimum, the standardized dataset must contain an ObjectID field and all the standardization fields defined by the SimpleStandardizeFields property. It is also a good idea to create a shape field in the output dataset (that is, create an output feature class) if you are standardizing the address information in a feature class and to copy the shapes from the input feature class to the output feature class.
The outputFieldNames parameter is a comma-delimited string that contains the names of the standardization fields in the standardized dataset. The names of the fields in this string must be specified in the same order as the field objects in the fields collection returned by the SimpleStandardizeFields property.
The fieldsToCopy parameter is a PropertySet defining the fields from the input dataset to copy to the output dataset. The names of the properties are the names of the fields in the output dataset, and the names of the properties are the names of the corresponding fields in the input dataset.
The following code example shows how to standardize the address information in a feature class using the ISimpleStandardization interface:
[VB.NET]
Dim pConnectionProperties As ESRI.ArcGIS.esriSystem.IPropertySet
Dim pWorkspaceFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory
Dim pFeatureWorkspace As ESRI.ArcGIS.Geodatabase.IFeatureWorkspace
Dim pFeatureClass As ESRI.ArcGIS.Geodatabase.IFeatureClass
Dim pLocatorManager As ESRI.ArcGIS.Location.ILocatorManager
Dim pLocatorWorkspace As ESRI.ArcGIS.Geodatabase.ILocatorWorkspace
Dim pSimpleStandardization As ESRI.ArcGIS.Location.ISimpleStandardization
Dim pFieldsEdit As ESRI.ArcGIS.Geodatabase.IFieldsEdit
Dim pFieldEdit As ESRI.ArcGIS.Geodatabase.IFieldEdit
Dim pStandardizationFields As ESRI.ArcGIS.Geodatabase.IFields
Dim strStandardizedFieldNames() As String
Dim lngStandardizationFieldsIndex As Long
Dim pUID As New ESRI.ArcGIS.esriSystem.UID
Dim pStandardizedFeatureClass As ESRI.ArcGIS.Geodatabase.IFeatureClass
Dim pFieldsToCopy As ESRI.ArcGIS.esriSystem.IPropertySet
' Open an ArcSDE workspace.
pConnectionProperties = New ESRI.ArcGIS.esriSystem.PropertySetClass
With pConnectionProperties
.SetProperty("server", "mendota")
.SetProperty("instance", "esri_sde")
.SetProperty("database", "arcobjects")
.SetProperty("user", "sde")
.SetProperty("password", "sde")
.SetProperty("version", "SDE.Default")
End With
pWorkspaceFactory = New ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass
pFeatureWorkspace = pWorkspaceFactory.Open(pConnectionProperties, 0)
' Open the feature class to standardize.
pFeatureClass = pFeatureWorkspace.OpenFeatureClass("arcobjects.SDE.Redlands_Street")
' Get the locator style to use to standardize the feature class.
pLocatorManager = New ESRI.ArcGIS.Location.LocatorManagerClass
pLocatorWorkspace = pLocatorManager.GetLocatorWorkspace(pFeatureWorkspace)
pSimpleStandardization = pLocatorWorkspace.GetLocatorStyle("SDE.US Streets")
' Create the feature class in which to write the standardization results.
' The feature class must contain an ObjectID field, a shape field, and the standardization fields.
pFieldsEdit = New ESRI.ArcGIS.Geodatabase.FieldClass
pFieldEdit = New ESRI.ArcGIS.Geodatabase.FieldClass
pFieldEdit.Name_2 = "ObjectID"
pFieldEdit.Type_2 = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeOID
pFieldsEdit.AddField(pFieldEdit)
pFieldsEdit.AddField( _
pFeatureClass.Fields.Field(pFeatureClass.Fields.FindField(pFeatureClass.ShapeFieldName)))
pStandardizationFields = pSimpleStandardization.SimpleStandardizeFields
ReDim strStandardizedFieldNames(0 To pStandardizationFields.FieldCount - 1)
For lngStandardizationFieldsIndex = 0 To pStandardizationFields.FieldCount - 1
pFieldsEdit.AddField(pStandardizationFields.Field(lngStandardizationFieldsIndex))
strStandardizedFieldNames(lngStandardizationFieldsIndex) = _
pStandardizationFields.Field(lngStandardizationFieldsIndex).Name
Next lngStandardizationFieldsIndex
pUID.Value = "esriGeodatabase.Feature"
pStandardizedFeatureClass = pFeatureWorkspace.CreateFeatureClass("Redlands_Standardized", _
pFieldsEdit, pUID, Nothing, ESRI.ArcGIS.Geodatabase.esriFeatureType.esriFTSimple, _
pFeatureClass.ShapeFieldName, "")
' Standardize the feature class.
pFieldsToCopy = New ESRI.ArcGIS.esriSystem.PropertySetClass
pFieldsToCopy.SetProperty(pFeatureClass.ShapeFieldName, pFeatureClass.ShapeFieldName)
pSimpleStandardization.SimpleStandardizeTable(pFeatureClass, "OBJECTID,FULL_NAME", "", _
pStandardizedFeatureClass, Join(strStandardizedFieldNames, ","), pFieldsToCopy, Nothing)
See Also:
Location library overview