Select to view content in your preferred language

Reverse Geocoding via Scripting

1001
0
08-05-2011 04:01 AM
PhillipeWernette1
New Contributor II
Hello,

I have recently run across a problem when trying to use the reverse geocode tool as a python script. We are working to assign addresses to new buildings (already have a points file) based on the existing roads and address range segments (already have this too). Reverse geocoding will work just fine when I use it in ArcMap, but won't run as a script. I even tried copying it as a python snippet from the geoprocessing results window. I need to assign new addresses to a large number of building points based off the existing addressing grid and would like to be able to automate this process for any future buildings. Below is a copy of what I have written. Creating the address locator works just fine and it works great in the geocoding toolbar as a locator. Not sure why the reverse geocoding function isn't working when scripted. Keep getting the error: "ERROR 999999: Error executing function," which doesn't really tell me anything other than it didn't work. I am using ArcInfo 10 SP2. Any assistance would be great.

-Phil

import arcpy

schema = "//san.intern/shared/gis_data/Projects/Address/Test/address.gdb"
street = "/Streets_MSU_Ranges"
toaddress = "/Proposed_Addrs"
addloc = "/MSU_Address_Locator"

#Create Address Locator
arcpy.CreateAddressLocator_geocoding("US Address - Dual Ranges", schema + street, "'Feature ID' OBJECTID VISIBLE NONE;'*From Left' FRADDL VISIBLE NONE;'*To Left' TOADDL VISIBLE NONE;'*From Right' FRADDR VISIBLE NONE;'*To Right' TOADDR VISIBLE NONE;'Prefix Direction' FEDIRP VISIBLE NONE;'Prefix Type' <None> VISIBLE NONE;'*Street Name' NAME VISIBLE NONE;'Suffix Type' FETYPE VISIBLE NONE;'Suffix Direction' <None> VISIBLE NONE;'Left City or Place' L_CITY_ID VISIBLE NONE;'Right City or Place' R_CITY_ID VISIBLE NONE;'Left ZIP Code' ZIPL VISIBLE NONE;'Right ZIP Code' ZIPR VISIBLE NONE;'Left State' STATE VISIBLE NONE;'Right State' STATE VISIBLE NONE;'Left Additional Field' <None> VISIBLE NONE;'Right Additional Field' <None> VISIBLE NONE;'Altname JoinID' '' VISIBLE NONE", schema + addloc)

#Reverse Geocode Proposed Addresses
arcpy.ReverseGeocode_geocoding(schema + toaddress, schema + addloc, "1000 Meters")
Tags (2)
0 Kudos
0 Replies