Standardize Address in 10.0

2450
2
05-20-2013 10:05 AM
GaryBushek
New Contributor III
I have some old code from 9.2 that tries to standardize an address stored in the database before trying to geocode that address.  The capability to call StandardAddress on the GeocdeServer object is no longer available.  I've tried numerous routes to standardize in 10.0 but everything leads to a dead end.  Is there a simple way to standardize an address in 10.0? 

Ive tried the following

    - ArcObjects
           can't get locator style using GetLocatorWorkspaceFromPath("") and GetLocatorStyle(US Address - Dual Ranges"). Returns an error that a locator by that name does not exist.

    - Geoprocessing Tool
           requires the address to be stored in a table/featureclass.  I just have a string. and don't want to go through everything involved in writing that value to a table and reading the new standardized address from a table.

    - Rest service
           no call to standardize address available


Thanks, Gary
0 Kudos
2 Replies
GaryBushek
New Contributor III
No one knows how to get a LocatorStyle programatically? .....wow    I create a locator in a folder with a specific LocatorStyle, obviously, but when i look at the locator enumeration retrieved from the locator workspace only the locator is visible. Is there no way to get the locator style that was used to create the locator???

        
        Dim locatorManager As ILocatorManager = New LocatorManagerClass
        Dim workspaceFactory As IWorkspaceFactory = New FileGDBWorkspaceFactoryClass
        Dim workspace As IWorkspace = workspaceFactory.OpenFromFile("C:\Locators\MyLocator.gdb", 0)
        Dim locatorWorkspace As ILocatorWorkspace = locatorManager.GetLocatorWorkspace(workspace)
        Dim _enum As IEnumLocator = locatorWorkspace.Locators(esriLocatorQuery.esriAllTypes, "")


Dim locatorStyle1 As ILocatorStyle = locatorWorkspace.GetLocatorStyle("US Address - Dual Ranges")


the last line of code just returns an error saying "A locator with this name does not exist in workspace"
0 Kudos
DavidClarke1
New Contributor III
The problem is that v10 locators only use the "iSimpleStandarization" interface.  What we do is detect the version of the locator: either v10 or prior.


For version 10 locators (or higher) we can use this.

Dim standardize As ESRI.ArcGIS.Location.ISimpleStandardization = locator
StandardizedPropertySet = standardize.SimpleStandardizeAddress(Address)
StandardizeFields = standardize.SimpleStandardizeFields()



For version 9.3.1 or prior locators, the old code should work just fine.

The trick then is to determine what type of locator you have (v9.3.1 or v10).

If TypeOf m_pLocator Is ESRI.ArcGIS.Location.IGeocodingProperties2 Then
     'You have a version 10 locator
End If
0 Kudos