1

This issue sounds like a repeat of ArcPy function works in ArcMap Python window but not from standalone script? but I am receiving a different outcome so this is why I am posting here.

The following is a simple geocoding script that works if loaded in the arcpy window but not running outside of Arc software. There is no error when running outside of Arc and it runs all the way through with a very low yield of geocoded features.

This is an issue with all Address Locators, Composite Locators and Custom Composite locators. Currently using StreetMap Premium 2017 R2 as the source for the custom Composite_Parcel locator listed below. The only difference between the Composite_Parcel and the standard USA_2017R2_TT_CompositeZip4 ESRI install is I changed the "Derive output geometry from display fields = No" to "Derive output geometry from display fields = Yes" in the USA_2017R2TT_PointAddress locator.

# Local variables:
tbl_WM_REPAIR_LEAKS_UAT_20190325113927 = "C\\ZZZZZ\\YYYYY\\XXXXXX\\\\Test Geocode\\Test Geocode.gdb\\tbl_UAT_20190325113927"
Composite_Parcels = "C:\\ZZZZZ\\YYYYY\\XXXXXX\\Composite_Parcels"
Geo_Model_Builder = "C:\\ZZZZZ\\YYYYY\\XXXXXX\\Test Geocode.gdb\\Geo_py_script_try_2"

# Process: Geocode Addresses
print 'Started Geocoding'
arcpy.GeocodeAddresses_geocoding(tbl_WM_REPAIR_LEAKS_UAT_20190325113927, Composite_Parcels,
                                 "Street AddrAdded VISIBLE NONE;City City VISIBLE NONE;State State VISIBLE NONE;ZIP <None> VISIBLE NONE;ZIP4 <None> VISIBLE NONE",
                                 Geo_Model_Builder, "STATIC")

If ran outside of Arc here is the breakdown by Loc_name:

  • Point Address: 285
  • Null: 2278

If loaded into arcpy window in Catalog or Maps here is the breakdown by Loc_name:

  • Point Address: 1830
  • Street Address: 525
  • StreetName: 84
  • Admin Places: 122
  • Null: 2

Software Specs:

  • Arc 10.4.1
  • Advanced License

Python:

  • Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32

I've tried to edit performance Search timeout of the Address Locator from 1 second to 10 seconds but this did not change the results of the output.

  • It's going to be difficult or even impossible for anyone to help much without knowing more about the composite locator. Is the source data for the individual locators located in a FGDB? Is it the same FGDB? Is stand alone python 64bit or 32bit? If 64bit, does 32bit work as expected? – Evil Genius Apr 16 at 13:13
  • @EvilGenius, I updated the description to include the address locators version. – kShort Apr 16 at 16:33
3

The issue to this problem was the Arc 10.4 python 2.7 32 bit environment. The arcpy.GeocodeAddresses_geocoding function runs on the Arc 10.4 2.7 64 bit background processing (there are a few other functions that run on 64 bit background processing).

To solve this I installed the C:\Python27\ArcGISx6410.4 background processing python package on my machine and created a Arc_104_64 bit python environment. I am now using this to execute the script outside the Arc software and it returns the same values as it does inside the Arc software.

The following are steps I took:

  • Install ArcGISx6410.4 python folder
  • Open Anaconda Prompt
  • conda create -n Arc_104_64 python=2.7.10
  • Proceed ([y]/n)? y
  • conda install - Arc_104_64 numpy=1.9.2 matplotlib=1.4.3 pysal
  • Copy from ArcGISx6410.4\Lib\site-packages: DTBGGP64.pth and matplolib-1.4.3-py2.7-nspkg.pth
  • Paste into Local\conda\conda\envs\Arc_104_64\Lib\site-packages folder

Ran the geocoding script in the newly create environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.