Geocoding in python - workk with Composite Locators?

1286
6
09-02-2016 07:04 AM
Zeke
by
Regular Contributor III

I've been trying to geocode a file geodatabase table against a composite locator in a python script. When I run it in PyScripter, it gives an EAccessViolation error, which according to Google is a memory error in the program (PyScripter).

But I also get an error when running it in IDLE, although the error message is far less detailed.

The composite locator is in a folder on another server. It has both point and road centerline locators. Is it possible to use a composite locator in python, or am I looking in the wrong direction?

    childcare_table = os.path.join(table_locations, "Childcare")
    geocoded_fc = os.path.join(table_locations, "LARA", "LARA_CDC")
    geocoder = r"\\gisfile\gis\Static\Geocoders\Composite_Locator"
    address_fields = "Street Fac_Addr;City City;Zip Zip"
    global ok

    try:
        print("\nRunning geocoding...")
        arcpy.GeocodeAddresses_geocoding(childcare_table, geocoder, address_fields, geocoded_fc)

    except:
         print("Unexpected error {0}\n\t{1}".format(sys.exc_info()[0], sys.exc_info()[1]))
         arcpy.AddError(sys.exc_info()[1])
         ok = False
0 Kudos
6 Replies
DanPatterson_Retired
MVP Esteemed Contributor

is there some bit to the script missing that indicates the actual path that you are working in? Like line 3? what is that joined to?

0 Kudos
Zeke
by
Regular Contributor III

Line 3 isn't joined to anything, that's the actual path name. table_locations is a module level variable set to

table_locations = r"O:\Greg_Working\GDB\Temp_Data.gdb"

0 Kudos
BruceHarold
Esri Regular Contributor

You can use a composite locator like you envision.  Try just the Geocode_Addresses geoprocessing tool manually with the arguments you want and check everything is OK then you will know it will work in code. 

0 Kudos
Zeke
by
Regular Contributor III

Thanks Bruce, but not working there either, at least in PyScripter. PyScripter - application error: Access violation at address 5E0E150C in module 'GpGeocodingFunctions.dll'. Read of address 00000000.

I can manually geocode the table in ArcCatalog by right clicking and selecting Geocode addresses.

0 Kudos
BruceHarold
Esri Regular Contributor

Its a mystery, I would log a support call.  I'll ask around the shop here if we're aware of any incompatibilities and reply here if I hear anything.

Zeke
by
Regular Contributor III

Thanks again. One other odd thing is that even when manually geocoding by right clicking, I can't change the default resulting file name from Geocoding_Result. Whenever I enter something else I get an Error saving file message.

0 Kudos