Geocoding using tasks.arcgisonline.com locators seems to end in error at random

2091
0
03-20-2013 02:33 PM
ramsesmadou
New Contributor
Hi Esri folks,

I have a python script I have been running batch geocoding through for the last 9 months or so. I pasted the python script at the bottom of this entry for reference. The script has been working fine until recently and I can't figure out what would have changed. I have python 2.6 installed, I have Arcinfo 10.0 with SP5 installed as well. And my work site (Stanford university) has a license for the online services.

The behavior that I am seeing is: when I submit addresses for geocoding I get an error at seemingly random places. I have submit the same set of 40,000+ addresses and had 2,000 returned as well as 10,000. This is with no change in the data and no change in the python script. NOTE: I also experience the same problem if I run the geocoding through the in program geocoder.

What should I be looking for to fix this?

Python script:
'''
Created on Aug 14, 2012

@author: rmadou
This script geocodes batches of addresses

To make this work you must add the geocoding service to ArcCatalog on your local machince. Here are instructions on how to do that:
1. Look in the Catalog Tree for GIS Services.
2. Expand that and select Add ArcGIS Server.
3. In the dialog, choose Use GIS services. Click Next.
4. For the Server URL, type: http://tasks.arcgisonline.com/arcgis/services
5. Press ok. You should now see arcgis on tasks.arcgisonline.com in that GIS servers list.
6. Expand the connection and expand the locators folder. Select and click on the locator you want to use.
7. Copy the full location path from the Location bar at the top of ArcCatalog.

you must also map your data headers to the GeocodeAddresses_geocoding headers

for more information on the arcpy function/s used here see:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/#/Geocode_Addresses/002600000006000000/
'''
import arcpy,time, datetime

#class Geocode():
#    def RunGeoCoding(self):
startTime = time.time()
print "geocoding started at", datetime.datetime.now()
# Set local variables:
address_table = r"All on import 2013-3-14 8th set.TXT"
print "address table loaded"
address_locator = r"GIS Servers\arcgis on tasks.arcgisonline.com\Locators\TA_Address_NA_10.GeocodeServer"
print "address locator loaded"
geocode_result = r"D:\Documents\Eclipse workspaces\PATS\geocode active 4D addresses\src\output shape files\all_on_import_2013-3-14_8th_set.shp"
print "output file created, but not yet populated"

arcpy.GeocodeAddresses_geocoding(address_table, address_locator, "Street Address VISIBLE NONE;City CITY VISIBLE NONE;State State VISIBLE NONE;Zip Zip VISIBLE NONE", geocode_result)
duration=time.time()-startTime
print "done! I took ",duration/60," minutes to run"
Tags (2)
0 Kudos
0 Replies