<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python Script Reverse Geocoding Fails in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344099#M26976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To see if it is related to the edit session, what if you try the workflow outside of an edit session?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2016 15:37:14 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2016-10-18T15:37:14Z</dc:date>
    <item>
      <title>Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344095#M26972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My intent is to reverse geocode points, and assign them their nearest address. &amp;nbsp;I have:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A master point feature class&lt;UL&gt;&lt;LI&gt;Which will ultimately need the address populated in a field&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;A "master script" that calculates a bunch of fields on the master point feature class&lt;UL&gt;&lt;LI&gt;I would like to ultimately add a section that joins the reverse geocoded addresses, calculates the appropriate address field on the master, and removes the join and deletes all the scratch data&lt;/LI&gt;&lt;LI&gt;The master script is pretty quick as to minimize down time, and would like to keep it that way&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My initial standalone script to reverse geocode took entirely to long to do as it was always reverse coding all the points, and as this points will increase it will eventually take longer. &amp;nbsp;So, I thought lets only select from the master point feature class, export those out, reverse geocode the selection, and then join the master feature class to do the join and field calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the reverse geocoding keeps crashing. &amp;nbsp;In PyScripter I get an "exceptions.EOFError:[Errno 10054] An existing connection was forcibly closed by the remote host" error. and just running the script cause python to crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does the first part correctly, which is exports out the features with missing addresses, but then crashes on the reverse geocoding part. &amp;nbsp;Below is the code I have thus far. &amp;nbsp;What am I doing wrong? &amp;nbsp;Am I missing something? Do I need to clean up some variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# import modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy


&lt;SPAN class="comment token"&gt;# Set workspaces&lt;/SPAN&gt;
scratchWorkspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb'&lt;/SPAN&gt;

selectExport &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Testing9716.gdb\GeoReporting'&lt;/SPAN&gt;
missingAddresses &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Match_Addr"&lt;/SPAN&gt;

sql &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"""{} is NULL"""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;missingAddresses&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Export Only missing Addresses"&lt;/SPAN&gt;
raw_input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Press enter to continue ;)"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Select concerns that have missing addresses and send them to a scratch workspace for geocoding&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FeatureClassToFeatureClass_conversion&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectExport&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; scratchWorkspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NoAddresses"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sql&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Export Successful"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Are You Ready to Start Reverse Geocoding?"&lt;/SPAN&gt;
raw_input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Press enter to continue ;)"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Start edit session&lt;/SPAN&gt;
edit &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;scratchWorkspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Additional Variables for reverse geocoding&lt;/SPAN&gt;

needsAddress &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb\NoAddresses'&lt;/SPAN&gt;
address_locator &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:/ESRITest/GeoReportingSystem/Testing9116/ActiveOnlyAddresses_CreateAd'&lt;/SPAN&gt;
outfc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\ESRITest\GeoReportingSystem\Testing9116\Scratch.gdb\NearestAddress2'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Reverse Geocode the missing addresses that were selected from the main concern features&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ReverseGeocode_geocoding&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;needsAddress&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; address_locator&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; address_type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ADDRESS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; search_distance&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"100 Meters"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Reverse Geocode Successful. Would you like to Exit?"&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# Close edit session&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

raw_input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Press enter to exit ;)"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:12:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344095#M26972</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2021-12-11T16:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344096#M26973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if my tool is an option for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8" title="http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8"&gt;http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2016 15:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344096#M26973</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2016-09-12T15:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344097#M26974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruce,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not think that will be an option for me. &amp;nbsp;We would like to use our own GeoCoder as to not consume a bunch of credits. &amp;nbsp;I appreciate the suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344097#M26974</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-10-18T15:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344098#M26975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After looking at into this further. &amp;nbsp;The script produces a geocoded result, but crashes before line 48 "print "Reverse Geocode Successful", and does not delete the unneeded scratch export. Is there a better way of doing what I trying to do? &amp;nbsp;Is something corrupted? &amp;nbsp;I am at a loss.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:09:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344098#M26975</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-10-18T15:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344099#M26976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To see if it is related to the edit session, what if you try the workflow outside of an edit session?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:37:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344099#M26976</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-10-18T15:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344100#M26977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well I have done a few things. &amp;nbsp;I have run the geoprocessing tool both in ArcMap and ArcCatalog using the same parameters minus the export. &amp;nbsp;I used NoAddresses in Scratch, and used the same locator, same output with no problems. &amp;nbsp;I then spelled it all out in the python window in ArcMap and ArcCatalog and crash. I do not know if it is a 10.3.1 thing or what. So what I have determined thus far is that it is a script thing, as the geoprocessing tool worked just fine.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:44:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344100#M26977</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-10-18T15:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344101#M26978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even if you were doing something wrong with the script, which I am not saying you are, the application shouldn't crash.&amp;nbsp; I would contact Esri Support because something needs to be addressed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344101#M26978</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-10-18T15:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344102#M26979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was hoping I would not have to, but it looks like that is going to be the answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 15:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344102#M26979</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2016-10-18T15:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script Reverse Geocoding Fails</title>
      <link>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344103#M26980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, after several months of trouble shooting and tech support, I think we have a winner. &amp;nbsp;When the script would run via idle, pyscripter, the task scheduler, etc. it was trying to use the 32 bit-version not the 64 bit-version. &amp;nbsp;It blows up with the 32 bit-version, but is perfectly ok with the 64 bit-version. &amp;nbsp;All I did was reconstitute the script and set it to use the 64 bit-version in the task scheduler and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will post more if anyone wants to know more.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 17:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-reverse-geocoding-fails/m-p/344103#M26980</guid>
      <dc:creator>DavidBuehler</dc:creator>
      <dc:date>2017-01-20T17:15:09Z</dc:date>
    </item>
  </channel>
</rss>

