ERROR 000010: Geocode addresses failed. Failed to execute (GeocodeAddresses)

5439
4
05-19-2013 07:11 AM
JulianKatz-Samuels
New Contributor
Hi all,

I'm trying to use python to geocode a set of files, but it returns the above error after a few minutes of running the code every time. I've read that I might need to convert my files into a .dbf format, but I'm not sure. I've put my code below.

#Julian Katz-Samuels
#May 1, 2013
#Geocode addresses

import arcpy

arcpy.env.workplace="X:\ebruch\shared"

parts=range(10)
parts.remove(0)
parts=map(str, parts)

years=["2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009"]

Geocoder = r"GIS Servers\arcgis on tasks.arcgisonline.com\Locators\TA_Address_NA_10.geocodeServer"

for i in years:
    for j in parts:
        address_table= r"X:\ebruch\shared\HistoryFile" + i + "_part" + j +".csv"
        geocode_result= r"X:\ebruch\shared\GeocodedHistoryFiles\GeocodedHistoryFile" + i + "_part" + j 
        arcpy.GeocodeAddresses_geocoding(address_table, Geocoder, "Address SRmailSTREETNAME VISIBLE NONE;City SRmailCITY VISIBLE NONE;State SRmailSTATE VISIBLE NONE;Zip SRmailZIP VISIBLE NONE", geocode_result, "STATIC")
print "Done!"



Best,
Julian
Tags (2)
0 Kudos
4 Replies
RichardFairhurst
MVP Honored Contributor
Hi all,

I'm trying to use python to geocode a set of files, but it returns the above error after a few minutes of running the code every time. I've read that I might need to convert my files into a .dbf format, but I'm not sure. I've put my code below.

#Julian Katz-Samuels
#May 1, 2013
#Geocode addresses

import arcpy

arcpy.env.workplace="X:\ebruch\shared"

parts=range(10)
parts.remove(0)
parts=map(str, parts)

years=["2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009"]

Geocoder = r"GIS Servers\arcgis on tasks.arcgisonline.com\Locators\TA_Address_NA_10.geocodeServer"

for i in years:
    for j in parts:
        address_table= r"X:\ebruch\shared\HistoryFile" + i + "_part" + j +".csv"
        geocode_result= r"X:\ebruch\shared\GeocodedHistoryFiles\GeocodedHistoryFile" + i + "_part" + j 
        arcpy.GeocodeAddresses_geocoding(address_table, Geocoder, "Address SRmailSTREETNAME VISIBLE NONE;City SRmailCITY VISIBLE NONE;State SRmailSTATE VISIBLE NONE;Zip SRmailZIP VISIBLE NONE", geocode_result, "STATIC")
print "Done!"



Best,
Julian


Did you look that error up to see if it has explanations about potential causes?  The text of the error you have written is very generic.  That could be the nature of the error, but the help sometimes gives details that narrow down what caused the error better than the error message.

Since the error is so generic, I would add a file exists test to verify a file with the input name you are feeding to the tool actually exists.  Not sure how good error messaging is when an input does not actually exist, but even a single character difference in a file name (a leading zero inconsistency for example) or a missing file name in the series would be the first error possibility I would eliminate.

You also have not set the geocode process flag that overwrites prior outputs.  If you ran this and an output continues to exist from a prior run I would expect a failure.  The tool you are using also may not support overwriting a prior output even if that flag is set.  In any case, it is possible the tool would only fail when it is nearly complete and actually attempting to overwrite a prior output.  Be sure to clean out all prior outputs before rerunning the code (or adjust the code to start at a point that will not impact the prior outputs).  Of course if no output has ever been generated by this code ever, that would be an important piece of information to help narrow down the cause of the error.

Other error possibilities exist, but these two are errors that commonly crop up when working through a series of files and attempting to rerun tools after a prior failure.
0 Kudos
JulianKatz-Samuels
New Contributor
Hi,

Thanks for the reply. The error is that it can't find the address locator. I don't understand why this is occuring since I checked that I got the correct file path. One odd thing is that it seems to be reading the file in incorrectly. Consider the following code and error:

>>> open(r'GIS Servers\arcgis on tasks.arcgisonline.com\Locators\TA_Address_NA_10.GeocodeServer')
Runtime error <type 'exceptions.IOError'>: [Errno 2] No such file or directory: 'GIS Servers\\arcgis on tasks.arcgisonline.com\\Locators\\TA_Address_NA_10.GeocodeServer'


It seems to read in too many back slashes. I have also tried to open other files on my computer in python in arcgis and it doesn't work. Could there be a problem with python in arcgis where it doesn't allow me to open other files?

Thanks,
Julian
0 Kudos
BruceHarold
Esri Regular Contributor
Hi

Your output locations need to be shapefile paths or geodatabase paths, as written you have just filenames.

Regards
RichardFairhurst
MVP Honored Contributor
Hi, 

Thanks for the reply. The error is that it can't find the address locator. I don't understand why this is occuring since I checked that I got the correct file path. One odd thing is that it seems to be reading the file in incorrectly. Consider the following code and error: 

>>> open(r'GIS Servers\arcgis on tasks.arcgisonline.com\Locators\TA_Address_NA_10.GeocodeServer')
Runtime error <type 'exceptions.IOError'>: [Errno 2] No such file or directory: 'GIS Servers\\arcgis on tasks.arcgisonline.com\\Locators\\TA_Address_NA_10.GeocodeServer'


It seems to read in too many back slashes. I have also tried to open other files on my computer in python in arcgis and it doesn't work. Could there be a problem with python in arcgis where it doesn't allow me to open other files? 

Thanks, 
Julian


The number of backslashes shown is correct, since backslash is an escape character to python and in order for python to resolve it as an actual character it either must be preceeded with the raw qualifier (the r in front of the quoted string) or each literal backslash character must be preceeded by an escape backslash character.

I don't know how your servers are set up, but in my system I would have expected two backslashes would preceed the server name if this is a dfs setup, i.e.,

open(r'\\GIS Servers\arcgis on tasks.arcgisonline.com\Locators\TA_Address_NA_10.GeocodeServer')
0 Kudos