gbushek

problem retrieving LocatorStyle

Discussion created by gbushek on Jul 24, 2013
Trying to get a locator style programatically to use to standardize addresses but can seem to get ahold of one. Please help.


        
        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, "")


I don't see any locator styles in the locator enumeration, only the locator.


a file called LocatorStyle.xsd and a file called LocatorStyle.xslt both exist in the 'Locators' folder but the below code also does not work to retrieve the locator style.

        Dim locatorManager As ILocatorManager = New LocatorManagerClass
        Dim locatorWorkspace As ILocatorWorkspace = locatorManager.GetLocatorWorkspaceFromPath("C:\Locators")
        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".  The enum also shows 0 as the count of locatorStyles in that folder.  Ideas???

Outcomes