Hello All,
I have searched through the forums and couldn't find a resolution to this, though people have experienced similar problems:
I have a fairly simple script that will:
I have tried:
arcpy.GeocodeAddresses_geocoding("C:/Users/v-robcha/Documents/ArcGIS/Default.gdb/GeocodeTemp","GIS Servers/geocoderfromESRI/World.GeocodeServer","SingleLine Address VISIBLE NONE","C:/Users/v-robcha/Documents/ArcGIS/Default.gdb/GeocodeTEMP_GeocodeAddresses_1","STATIC")
But when I try to use that EXACT line (hard coded file paths and all) in a script tool the geocoded results are empty. No matched or unmatched, just zero features. Furthermore, when I try to use variables for the file paths it returns the same result (nothing).
Below is the full script, I am quite frustrated at this point.
# Import arcpy module import arcpy import csv import os arcpy.env.workspace = r"C:/Users/v-robcha/Documents/ArcGIS/Default.gdb" ws = arcpy.env.workspace #address to be geocoded address = arcpy.GetParameterAsText(0) #geocode service geocoder = r"GIS Servers\geocoderfromESRI\World.GeocodeServer" # dbf template for geocoding dbftemplate = "TemplateGeocode" # geocode output fn GeocodeAddressOut = "GeocodeAddresses_please" # user parameter for facilities (hotels, avis, etc) ## set up list of choices ## FacilitiesLocations = "AvisLocations_All1" # create table to store user input address arcpy.CreateTable_management(ws,"GeocodeTemp",dbftemplate,"#") ifields = ["OBJECTID", "Address"] irow = ["0", address] icur = arcpy.da.InsertCursor("GeocodeTemp", ifields) icur.insertRow(irow) # Process: Geocode Addresses arcpy.GeocodeAddresses_geocoding("GeocodeTemp", geocoder, "SingleLine Address VISIBLE NONE", GeocodeAddressOut, "STATIC")
Haven't looked in detail, however, you don't mix raw format with forward slashes in
arcpy.env.workspace = r"C:/Users/v-robcha/Documents/ArcGIS/Default.gdb"
get rid of the "r" in the path
Good catch. However, that bad syntax on my part has never caused me issues.
But it also didn't solve this issue.
Bump.
Still struggling. Any help would be appreciated.
We're having the exact same problem. Single Field Locator fails to match any addresses when run in python, but works fine when run in ArcMap. Other Locators, like US Dual Range, work fine. Went back to a machine with ArcGIS 10.1 installed and ran the script pointing to the same datasources and it works just fine. Everything points to problems with the Single Field Locator being run as a python script outside ArcMap on a 10.2.1 client.
A coworker of mine, Darris Friend, found the problem. We're using address points with the "General - Single Field" geocoder. At 10.1 and earlier, the syntax for the python script was:
arcpy.GeocodeAddresses_geocoding({TableOfAddresses}, {GeocoderName}, "SingleKey {AddressFieldName} VISIBLE NONE", etc...)
At 10.2 it's now:
arcpy.GeocodeAddresses_geocoding({TableOfAddresses}, {GeocoderName}, "'Single Line Input' {AddressFieldName} VISIBLE NONE", etc...)
So SingleKey changed to 'Single Line Input'. Make sure you include the single quotes.
After trying a lot of different 'solutions' to the generic Error 000010 that the geocoder throws when following the examples in the documentation, this one provided by @brownkj worked:
arcpy.GeocodeAddresses_geocoding(permittable, geocoder, "'Single Line Input' ADDRESS VISIBLE NONE", outFC)
With over 5177 Views at the time of writing this (~862 a year, 2.3 times a day since the original posting), I'm resurrecting this solution to tag Error 000010 so hopefully it helps others find a solution a lot faster than I did.