AnsweredAssumed Answered

Runtime error trying to geocode table

Question asked by recurvata on Oct 13, 2016

I'm getting a runtime error when trying to geocode a table in a script. Geocoding works fine when done manually in ArcCatalog - right clicking the table and selecting Geocode addresses in the popup.But running it in Pyscripter, Idle or the Python window in ArcMap all give the error. I've also tried different machines.

 

I've tried different variations on this, from just using the table name instead of a view to changing how the address fields are formatted.  The only thing that changes is that if the address fields aren't in a list, the error becomes an application error - access violation - that just ends the program without ever hitting the exception.  I've used the documentation as a reference. Any and all help appreciated, thanks.

 

Code and error below:

 

    try:
        print("In geocode_facilities...\n")
        address_fields = [["Street Street"], ["City Fac_City"], ["Zip Fac_Zip"]]
        cdc = arcpy.MakeTableView_management(childcare_table, "cdc_view")
        arcpy.GeocodeAddresses_geocoding(cdc, geocoder, address_fields, geocoded_fc, "STATIC")

    except RuntimeError as e:
        msg = "Error geocoding table in geocode_facilities():\n\t {0}".format(traceback.format_exc())
        traceback.print_exc()
        error_list.append(msg + '\n')

""" Error is:
Traceback (most recent call last):
  File "G:\Scripts\LARA_CDC_Download.py", line 248, in geocode_facilities
    arcpy.GeocodeAddresses_geocoding(cdc, geocoder, address_fields, geocoded_fc, "STATIC")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geocoding.py", line 212, in GeocodeAddresses
    raise e
RuntimeError: Object: Error in executing tool
"""

Outcomes