ERROR
When geocoding through Avenue, ArcView returns this error:"Unable to set MatchKey field."
Use of the SetZoneKey request when matching intersections is not allowed. ArcView does not support intersection matching with zones through Avenue.
If the theme's MatchSource is using an address style with Zone (US Streets with Zone, US House with Zone, and so forth), don't set the Zone to the MatchKey (aMatchKey.SetZoneKey). The following script does basic matching:
Code:
theInput = msgbox.multiinput("","",{"address","zone"},{"",""})
theGraphicList = av.getactivedoc.GetGraphics
address=theInput.get(0)
city=theInput.get(1)
matchTheme = av.getactivedoc.FindTheme("Streets")
aMatchSource = matchTheme.GetMatchSource
aMatchSource.OpenIndex
aMatchKey = MatchKey.Make(aMatchSource.GetStanRules)
aMatchKey.AllowIntersections("us_intsc.stn", " & ")
aMatchCase = MatchCase.Make(aMatchSource, aMatchKey)
aMatchCase.AllowIntersections(aMatchSource, aMatchKey)
aMatchPref = MatchPref.Make
aMatchKey.SetKey(address)
if (address.Contains("&").Not) ' <******
then ' <******
if (aMatchSource.HasZone) ' <******
then ' <******
aMatchKey.SetZoneKey(city) ' <******
end ' <******
end ' <******
numCand = aMatchSource.Search(aMatchKey,80,aMatchCase)
if (numCand = 0) then
av.ShowMsg(address.Proper++"not found!")
return nil
else
aMatchCase.ScoreCandidates
bestCand = aMatchCase.GetBestCand
Location = aMatchSource.GetPoint( bestCand )
aMatchSource.EndMatch
gPt = GraphicShape.Make(Location)
theGraphicList.Add(gPt)
end
Article ID:000003616
Get help from ArcGIS experts
Download the Esri Support App