Select to view content in your preferred language

Composite Locator doesn't work

1930
2
07-29-2011 09:18 AM
LorindaGilbert
Frequent Contributor
Okay,
Getting nowhere fast on the Python thread, so I will try here too.
I have created a composite address locator that runs perfectly well in ArcMap. When I run it as a python command, nothing matches - as in all are unmatched; when run in ArcMap only one doesn't match.

When running one of the address locators -point locator- by itself, it runs from python and matches as expected.

Why can't you use a composite locator in Python? That seems to defeat the purpose of allowing them in the first place. There are many times when the data doesn't hit on one locator. The data in this case is coming in as both single point addresses and as intersections. And some of the addresses don't match exactly to the situs address we have in the system, but they do match as a range on the street.

I'm attempting to write a python script that will be a one button tool for some folks that don't work in ArcMap every day.

snippets of code:
CAUfile = "caufile.txt"
AddLoc1 = "PointAddressLocator"
AddLoc2 = "StreetLocator"
AddComp = "CompositeLocator"
GeoColumn = "Address Adress VISIBLE NONE"

arcpy.env.overwriteOutput = True

arcpy.GeocodeAddresses_geocoding(CAUfile,AddComp,GeoColumn,wksp+"\Geoed")

I have tried it as well with GeoColumn = "Address"

Running Win7 x64; Arc10 SP1

The PointLocator uses single field of address
StreetLocator uses Address with nothing for the City

Thanks
Tags (2)
0 Kudos
2 Replies
BrianOevermann
Frequent Contributor
Lorinda,

While I have not done what you are attempting to do in Python, I'll share some thoughts.

I agree that the composite locator should just "work".  After all, when you create the composite locator, internally it knows which locators are participating.  But when I use a composite locator in my web apps, I must make sure that I not only publish the composite locator but also all of the constituent locators the composite uses.  Maybe there is a requirement with Python to instantiate the individual locators used in the composite?

In the ArcIMS days (b.c.l. - before composite locators) I accomplished the same fall-back processing of addresses via an If-Then-Else construct, re-matching the address against each subsequent locator until I achieved success.  Maybe ESRI programmers envisioned that one would not use a composite locator and instead use a custom logical workflow such as this?  Regardless of what ESRI may have envisioned, you could still achieve the functionality you want in your tool by processing and evaluating the results against each locator in the way I described above.
0 Kudos
BrianOevermann
Frequent Contributor
Anthony,

Please share what you did to get this to work!  While I do not have an immediate need for the information, I can think of some future scenarios that will likely cause me to work through this in Python scripting and not needing to reinvent the wheel will be a bonus.
0 Kudos