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
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?
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"
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.
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.
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.
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.