Select to view content in your preferred language

IGeocodingProperties will not apply to ArcGIS 10.0 Locators

715
3
10-26-2010 05:28 PM
JonHall
Frequent Contributor
I'm working on using an ArcGIS Desktop 10.0 client to create ArcGIS 10.0 Locators, and I've resolved all the significant issues except applying IGeocodingProperties.

When I create Locators, they are created with default ESRI GeocodingProperties properties, and I need to programatically change several of these props; i.e. change SpellingSensitivity from 80 to 63

I need to be able to create ArcGIS 10.0 Locators in any of 5 "flavors" of geodatabase: ArcSDE 10.0 Enterprise, Workgroup, or Desktop; and ArcGIS 10 File geodatabase or Personal geodatabase (mdb).

I can create them, I just cannot set their GeocodingProperties programatically.

I also need to continue support for creating ArcGIS 9.3.1 Locators in any of 5 "flavors" of geodatabase: ArcSDE 9.3.1 Enterprise, Workgroup, or Desktop; and ArcGIS 9.3.1 File geodatabase or Personal geodatabase (mdb).

I'm updating code that created Locators with no errors in ArcGIS 9.0 thru 9.3.1 SP2. I've finally figured out how to adapt the existing code to support creating the old Arc9-style Locators in Arc9 databases, using an ArcGIS Desktop 10 client (ILocatorManager.GetLocatorWorkspaceFromPath must point at a copy of the ArcGIS 9 \Locators\ folder; not easy to do, after you've uninstalled all ArcGIS 9 products...).

I had tried the newer IGeocodingProperties2 (and ILocator2) interfaces without success, which also broke the ability to create ArcGIS 9.3.1 Locators

I can create ArcGIS 9.3.1 Locators, AND SET THEIR GEOCODING PROPERTIES, in ArcSDE 9.3.1 Desktop, ArcGIS 9.3.1 File and Personal geodatabases, after going back to using IGeocodingProperties and ILocator

In the past, we have set the IGeocodingProperties of the ILocator before ILocatorWorkspace.AddLocator.  This works for ArcGIS 9 database locators.  For ArcGIS 10 database locators, I cannot set IGeocodingProperties of the ILocator before or after ILocatorWorkspace.AddLocator.

I can list the properties in DEBUG, and they appear correct, but as soon as I check the ArcGIS 10 Locator in ArcCatalog 10, it has retained the default props.

Any suggestions, before I open an ESRI tech support request?
Thanks-
0 Kudos
3 Replies
JonHall
Frequent Contributor
Pass this code an ArcGIS 10 "US Address - Dual Ranges" Locator; the Output window will show the before & after settings, confirming the changes, but then ArcCatalog will show the Locator still has ESRI's default property settings; this same code works if you pass an ArcGIS 9 "US Streets with Zone" Locator.

If Not IsNothing(pLocator) Then
 'pGeocodingProperties = CType(pLocator, IGeocodingProperties2)  '10/25/2010, cannot cast Arc9 Locator to IGeocodingProperties2, go back to older interface 
 pGeocodingProperties = CType(pLocator, IGeocodingProperties)

 ''print out the ESRI default properties BEFORE resetting them:
 Debug.Print("SpellingSensitivity: " & pGeocodingProperties.SpellingSensitivity.ToString)
 Debug.Print("MinimumCandidateScore: " & pGeocodingProperties.MinimumCandidateScore.ToString)
 Debug.Print("MinimumMatchScore: " & pGeocodingProperties.MinimumMatchScore.ToString)
 Debug.Print("SideOffset: " & pGeocodingProperties.SideOffset.ToString)
 Dim iEsriUnits As Int32 = pGeocodingProperties.SideOffsetUnits 'esriSystem.esriUnits
 Select Case iEsriUnits
  Case 0
   Debug.Print("SideOffsetUnits: Unknown")
  Case 1
   Debug.Print("SideOffsetUnits: Inches")
  Case 2
   Debug.Print("SideOffsetUnits: Points")
  Case 3
   Debug.Print("SideOffsetUnits: Feet")
  Case 4
   Debug.Print("SideOffsetUnits: Yards")
  Case 5
   Debug.Print("SideOffsetUnits: Miles")
  Case 6
   Debug.Print("SideOffsetUnits: Nautical miles")
  Case 7
   Debug.Print("SideOffsetUnits: Millimeters")
  Case 8
   Debug.Print("SideOffsetUnits: Centimeters")
  Case 9
   Debug.Print("SideOffsetUnits: Meters")
  Case 10
   Debug.Print("SideOffsetUnits: Kilometers")
  Case 11
   Debug.Print("SideOffsetUnits: Decimal degrees")
  Case 12
   Debug.Print("SideOffsetUnits: Decimeters")
  Case Else
   Debug.Print("SideOffsetUnits: other")
 End Select
 Debug.Print("MatchIfScoresTie: " & pGeocodingProperties.MatchIfScoresTie.ToString)

 Debug.Print("AddXYCoordsToMatchFields: " & pGeocodingProperties.AddXYCoordsToMatchFields.ToString)
 Debug.Print("AddReferenceIDToMatchFields: " & pGeocodingProperties.AddReferenceIDToMatchFields.ToString)
 Debug.Print("AddPercentAlongToMatchFields: " & pGeocodingProperties.AddPercentAlongToMatchFields.ToString)
 'Debug.Print("AddStandardizeStringToMatchFields: " & pGeocodingProperties.AddStandardizeStringToMatchFields.ToString)


 With pGeocodingProperties
  .SpellingSensitivity = 63
  .MinimumCandidateScore = 10
  .MinimumMatchScore = 30
  .SideOffset = 20
  .SideOffsetUnits = esriUnits.esriFeet
  .AddXYCoordsToMatchFields = True
  .AddReferenceIDToMatchFields = True
  .AddPercentAlongToMatchFields = True
  '.AddStandardizeStringToMatchFields = True
  '10/04/2010, ArcGIS 10.0 bug: AddStandardizeStringToMatchFields: "The method or operation is not implemented."} System.NotImplementedException
  '10/08/2010, the Output Fields checkbox for "Standardized address" is grayed-out in ArcCatalog 10.0 Locator Properties for "US Address -Dual Zone"
 End With
 val = pLocator

 ''NOW print out the properties AFTER resetting them:
 Debug.Print(vbNewLine & "SpellingSensitivity: " & pGeocodingProperties.SpellingSensitivity.ToString)
 Debug.Print("MinimumCandidateScore: " & pGeocodingProperties.MinimumCandidateScore.ToString)
 Debug.Print("MinimumMatchScore: " & pGeocodingProperties.MinimumMatchScore.ToString)
 Debug.Print("SideOffset: " & pGeocodingProperties.SideOffset.ToString)
 'Dim iEsriUnits As Int32 = pGeocodingProperties.SideOffsetUnits 'esriSystem.esriUnits
 Select Case iEsriUnits
  Case 0
   Debug.Print("SideOffsetUnits: Unknown")
  Case 1
   Debug.Print("SideOffsetUnits: Inches")
  Case 2
   Debug.Print("SideOffsetUnits: Points")
  Case 3
   Debug.Print("SideOffsetUnits: Feet")
  Case 4
   Debug.Print("SideOffsetUnits: Yards")
  Case 5
   Debug.Print("SideOffsetUnits: Miles")
  Case 6
   Debug.Print("SideOffsetUnits: Nautical miles")
  Case 7
   Debug.Print("SideOffsetUnits: Millimeters")
  Case 8
   Debug.Print("SideOffsetUnits: Centimeters")
  Case 9
   Debug.Print("SideOffsetUnits: Meters")
  Case 10
   Debug.Print("SideOffsetUnits: Kilometers")
  Case 11
   Debug.Print("SideOffsetUnits: Decimal degrees")
  Case 12
   Debug.Print("SideOffsetUnits: Decimeters")
  Case Else
   Debug.Print("SideOffsetUnits: other")
 End Select
 Debug.Print("MatchIfScoresTie: " & pGeocodingProperties.MatchIfScoresTie.ToString)

 Debug.Print("AddXYCoordsToMatchFields: " & pGeocodingProperties.AddXYCoordsToMatchFields.ToString)
 Debug.Print("AddReferenceIDToMatchFields: " & pGeocodingProperties.AddReferenceIDToMatchFields.ToString)
 Debug.Print("AddPercentAlongToMatchFields: " & pGeocodingProperties.AddPercentAlongToMatchFields.ToString)
 'Debug.Print("AddStandardizeStringToMatchFields: " & pGeocodingProperties.AddStandardizeStringToMatchFields.ToString)


End If
0 Kudos
JonHall
Frequent Contributor
I've logged a support incident with ESRI, and will report back when I hear something...
0 Kudos
JonHall
Frequent Contributor
We're going to wait a few days until Service Pack 1 is released, to see if the several Locator bug-fixes in SP1 happen to resolve this issue, before spending any more time on this IGeocodingProperties support incident.

ESRI support gave me a link to an ArcGIS 10.0 Service Pack 1 announcement (10.0_SP1_Announcement.pdf) on their download site, which said SP1 will "...be available late Oct. or early Nov."
0 Kudos