<?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 Python to GP service mystery in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86375#M6786</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have this python script that basically selects a point by it's ID, then selects all points within a distance and returns only a subset of those that match the type field.&amp;nbsp; i.e. find all hospitals within 3 miles of this location..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My python script works, does what it's supposed to. So I create a GP service from it. Add the service back into the map and run it. Now I notice no matter what distance I use, the data doesn't change. If I delete the created Featureclass to see if it's really working. It does not create a new featureclass but it says it completed successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the weird part, if I hit the GP service at the rest endpoint with the parameters it says it works but returns no records. I've been careful to avoid schema locks when using the Rest endpoint ArcMap and ArcCatalog are closed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's like the GP service doesn't have permission to write to the sde database, However my sde connection works fine on my PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2015 15:31:05 GMT</pubDate>
    <dc:creator>BillChappell</dc:creator>
    <dc:date>2015-10-08T15:31:05Z</dc:date>
    <item>
      <title>Python to GP service mystery</title>
      <link>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86375#M6786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have this python script that basically selects a point by it's ID, then selects all points within a distance and returns only a subset of those that match the type field.&amp;nbsp; i.e. find all hospitals within 3 miles of this location..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My python script works, does what it's supposed to. So I create a GP service from it. Add the service back into the map and run it. Now I notice no matter what distance I use, the data doesn't change. If I delete the created Featureclass to see if it's really working. It does not create a new featureclass but it says it completed successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the weird part, if I hit the GP service at the rest endpoint with the parameters it says it works but returns no records. I've been careful to avoid schema locks when using the Rest endpoint ArcMap and ArcCatalog are closed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's like the GP service doesn't have permission to write to the sde database, However my sde connection works fine on my PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 15:31:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86375#M6786</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2015-10-08T15:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Python to GP service mystery</title>
      <link>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86376#M6787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some questions I'd start with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you overwriting the outputs of existing geoproceessing operations?&lt;/P&gt;&lt;P&gt;Where are you you writing intermediate data to? Is the output fc being written to your default gdb?&lt;/P&gt;&lt;P&gt;Have you parameterized the output layer?&lt;/P&gt;&lt;P&gt;What do you have set for your current and scratch workspace environments?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 18:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86376#M6787</guid>
      <dc:creator>DanielStauning</dc:creator>
      <dc:date>2015-10-08T18:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python to GP service mystery</title>
      <link>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86377#M6788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writing to the SDE database, overwriting the existing FC, after the points have been collected, I go from a feature layer to a featureclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe my code will help, it's fairly simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; os&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; string&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;from&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; env&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;theworkspace &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; r&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"Connection to racdev1.sde"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;env&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;workspace &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; theworkspace&lt;BR /&gt;&lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;env&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;overwriteOutput &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;True&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;#facilityID = '1249'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;facilityID &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;GetParameterAsText&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;0&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;#facilityIDType= 'PFI'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;facilityIDType &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;GetParameterAsText&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;thedistance &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;GetParameterAsText&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;#thedistance = '3 miles'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;#withindistance = "3 Miles"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;withindistance &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&amp;nbsp; thedistance &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;+&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;' Miles'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;sql_query &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"\"%s\" = '%s'"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;%&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"ID"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; facilityID&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;sql_query2 &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"\"%s\" = '%s'"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;%&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"IDTYPE"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; facilityIDType&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;# Local variables:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Facilities&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"DOHGIS.NYSDOH_CI_DATA"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;featLayer &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"thePts"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;MakeFeatureLayer_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Facilities&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; featLayer&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;# Process: Select Layer By Attribute&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;SelectLayerByAttribute_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;featLayer&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; sql_query&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;# Process: Select Layer By Location 311&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;SelectLayerByLocation_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;featLayer&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"WITHIN_A_DISTANCE"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;featLayer&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; withindistance&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;#print " now for the subset"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;SelectLayerByAttribute_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"thePts"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"SUBSET_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; sql_query2&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;# creaate the new featureclss.. &lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;CopyFeatures_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"thePts"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="str"&gt;'DOHGIS.NYSDOH_FacilitiesQuery'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="com"&gt;#print "Done"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2015 18:27:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-to-gp-service-mystery/m-p/86377#M6788</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2015-10-08T18:27:20Z</dc:date>
    </item>
  </channel>
</rss>

