Select to view content in your preferred language

Geocoding Script failing for Data on sde

4122
11
Jump to solution
01-29-2016 01:10 PM
TiffanySelvidge1
Frequent Contributor

I know this is a topic that has come up multiple times but I have gone through all the previous discussions and my geocoding is still failing. My script is from a modelbuilder I exported as python. I am using a composite geolocator with files that are updated daily. My table is from sql and is updated every 30 minutes.

I am using Arc 10.3.1, Python 2.7

Here is what I have already tried:

I have formatted my addresses to contain the exact address.

I have included overwrite = true.

I have changed SingleKey to Single Line Input and then just removed it completely.

I have changed the double quotes on Static to single quotes.

# Import arcpy module

import arcpy

#Overwrite pre-existing files
arcpy.env.overwriteOutput = True
# Local variables:
ArcDev_dbo_OIDTest_sites_2015i_2016_new = "C:\\Users\\tselvidge\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\arcdev@srvarcdev.sde\\ArcDev.dbo.OIDTest_sites_2015i_2016_new"
  1. GISOWNER_ParcelAddrFacet_geo__2_ = "C:\\Users\\tselvidge\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\arcdev@srvarcdev.sde\\ArcDEV.GISOWNER.ParcelAddrFacet_geo" ArcDev_GISOWNER_GeoRecs_New = "C:\\Users\\tselvidge\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\arcdev@srvarcdev.sde\\ArcDev.GISOWNER.Sharept_symbolized\\ArcDev.GISOWNER.GeoRecs_New" ArcDev_GISOWNER_GeoRecs_New__3_ = ArcDev_GISOWNER_GeoRecs_New ArcDev_GISOWNER_GeoRecs_New__4_ = ArcDev_GISOWNER_GeoRecs_New__3_

# Process: Geocode Addresses
arcpy.GeocodeAddresses_geocoding(ArcDev_dbo_OIDTest_sites_2015i_2016_new, GISOWNER_ParcelAddrFacet_geo__2_, "'Single Line Input' AcctNo VISIBLE NONE;HCAD_NUM AcctNo VISIBLE NONE;Street Street VISIBLE NONE;City City VISIBLE NONE;State <None> VISIBLE NONE;ZIP ZIP VISIBLE NONE;QFNAME FileMapFacet VISIBLE NONE", ArcDev_GISOWNER_GeoRecs_New, 'STATIC')
0 Kudos
1 Solution

Accepted Solutions
TiffanySelvidge1
Frequent Contributor

Bruce,

Thank you for your help!

It is now working from local and virtual server. I took out the space from "'single line input'" as you advised. When running from my local, I needed to use 'Database Connections' but on the virtual server I needed to use the entire path but without the r's. When I added r's the script became confused. I also had to change another parameter within the geocoding and modify the server connection from my personal login (admin) to gisowner login.

So it took a variety of modifications for each machine but at least it now works.

For now I am keeping the composite locator with the various locators. If it ends up breaking, I will change it. I am waiting since the workaround will be rather clumsy and significantly less efficient than what I currently have setup.

View solution in original post

0 Kudos
11 Replies
BruceHarold
Esri Regular Contributor

Tiffany, use raw text notation for data like that, you have '\t' in the path, which is a tab when read.

i.e put 'r' ahead of your string:

r"C:\\Users\\tselvidge\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\arcdev@srvarcdev.sde\\ArcDEV.GISOWNER.ParcelAddrFacet_geo"

TiffanySelvidge1
Frequent Contributor

I put an 'r' in front but it still doesn't work.

0 Kudos
BruceHarold
Esri Regular Contributor

Sorry, another thing: the single like parameter is 'SingleLine', e.g.:

Executing: GeocodeAddresses HalfMoonBay "GIS Servers\arcgis on geocode.arcgis.com (user)\World.GeocodeServer" "SingleLine SingleLine VISIBLE NONE" C:\Users\bruc5588\Documents\ArcGIS\Projects\GeocodingDemo.gdb\Tiffany STATIC

0 Kudos
TiffanySelvidge1
Frequent Contributor

I made the change but I am still receiving the "ERROR 000010: Geocode addresses failed."

Here is the complete Traceback message:

  File "C:\Users\tselvidge\Documents\Dashboard\Scheduled_jobs\SharepointNewDataTest.py", line 25, in <module>

    arcpy.GeocodeAddresses_geocoding(ArcDev_dbo_OIDTest_sites_2015i_2016_new, GISOWNER_ParcelAddrFacet_geo__2_, "SingleLine AcctNo VISIBLE NONE;HCAD_NUM AcctNo VISIBLE NONE;Street Street VISIBLE NONE;City City VISIBLE NONE;State <None> VISIBLE NONE;ZIP ZIP VISIBLE NONE;QFNAME FileMapFacet VISIBLE NONE", ArcDev_GISOWNER_GeoRecs_New, 'STATIC')

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geocoding.py", line 212, in GeocodeAddresses

    raise e

ExecuteError: ERROR 000010: Geocode addresses failed.

Failed to execute (GeocodeAddresses).

0 Kudos
BruceHarold
Esri Regular Contributor

Tiffany I may have put you wrong earlier, I just did a single line input process and the input fields are stated like this:

in_address_fields="'Single Line Input' SingleLine VISIBLE NONE"

i.e. there should not be any more fields than just one, and the parameter is 'Single Line Input'.

Regards

TiffanySelvidge1
Frequent Contributor

I am using a composite locator. If I can only list one field then how does it know to geocode based upon the other fields in the other locators?

0 Kudos
BruceHarold
Esri Regular Contributor

Tiffany, you cannot mix single and multi line handling in a composite locator.

0 Kudos
TiffanySelvidge1
Frequent Contributor

Interesting. I guess Python just can't handle it? Running the model in arcCatalog it works just fine.

0 Kudos
BruceHarold
Esri Regular Contributor

I just tried a composite with a field having the full address details (i.e single line) in a field I mapped to the ADDRESS input of a multiline run, and the other zone fields mapped normally, and I got the 000010 error, so its probably just data-dependent luck it works for you.

Messages

Executing: GeocodeAddresses D:\Work\Product_Management\LINZAddressing\lds-new-zealand-17layers-FGDB\StreetAddress.gdb\HalfMoonBay D:\Work\Product_Management\LINZAddressing\TestComposite "Address SingleLine VISIBLE NONE;Neighborhood <None> VISIBLE NONE;City SUBURB VISIBLE NONE;Subregion <None> VISIBLE NONE;Region MAILTOWN VISIBLE NONE;Postal POSTCODE VISIBLE NONE;PostalExt <None> VISIBLE NONE;CountryCode <None> VISIBLE NONE" D:\Work\Product_Management\LINZAddressing\lds-new-zealand-17layers-FGDB\StreetAddress.gdb\Geocode_Result STATIC

Start Time: Mon Feb 01 08:37:02 2016

Executing Geocode Addresses...

ERROR 000010: Geocode addresses failed.

Failed to execute (GeocodeAddresses).

Failed at Mon Feb 01 08:37:07 2016 (Elapsed Time: 5.32 seconds)