<?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 Publish python script as geoprocessing service using a locator service in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231648#M8948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that involves some geocoding. For the geocoding, I am using an existing locator service hosted on our AGS. When I go to publish the python script as a geoprocessing service, it wants to copy the locator to the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to publish a geoprocessing script that uses an existing locator service without having to copy the locator to the server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AGS 10.2.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2017 19:14:53 GMT</pubDate>
    <dc:creator>ShaunConway</dc:creator>
    <dc:date>2017-03-06T19:14:53Z</dc:date>
    <item>
      <title>Publish python script as geoprocessing service using a locator service</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231648#M8948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that involves some geocoding. For the geocoding, I am using an existing locator service hosted on our AGS. When I go to publish the python script as a geoprocessing service, it wants to copy the locator to the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to publish a geoprocessing script that uses an existing locator service without having to copy the locator to the server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AGS 10.2.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 19:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231648#M8948</guid>
      <dc:creator>ShaunConway</dc:creator>
      <dc:date>2017-03-06T19:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Publish python script as geoprocessing service using a locator service</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231649#M8949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I'm not sure if there's a workaround for that. &amp;nbsp;If you are hosting the geocode service yourself, why not just reference the locators on disk instead of referencing the service?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231649#M8949</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2017-03-07T17:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Publish python script as geoprocessing service using a locator service</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231650#M8950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jonathan. I figured this out shortly after posting. Our need really was only to geocode a single address, then find intersecting project area. For this workflow I found that just calling the geocoding service and decoding the JSON response worked great. Turns out, it was also much faster than using arcpy.GeocodeAddresses_geocoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;gcUrl = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmapviewer.lynchburgva.gov%2Farcgis%2Frest%2Fservices%2FLocators%2FComposite%2FGeocodeServer%2FfindAddressCandidates%3FStreet%3D%26City%3D%26ZIP%3D%26SingleLine%3D" rel="nofollow" target="_blank"&gt;https://mapviewer.lynchburgva.gov/arcgis/rest/services/Locators/Composite/GeocodeServer/findAddressCandidates?Street=&amp;amp;City=&amp;amp;ZIP=&amp;amp;SingleLine=&lt;/A&gt;&lt;SPAN&gt;"+ arcpy.GetParameterAsText(0) + "&amp;amp;outFields=&amp;amp;maxLocations=&amp;amp;outSR=&amp;amp;searchExtent=&amp;amp;f=pjson"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;response = urllib.urlopen(gcUrl)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data = json.loads(response.read())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with open('gcAddress.json', 'w')&amp;nbsp; as outfile:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; json.dump(data, outfile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gcPoint = arcpy.Point(data["candidates"][0]["location"]["x"], data["candidates"][0]["location"]["y"])&lt;BR /&gt;arcpy.MakeFeatureLayer_management(projectArea,projectArea_Layer)&lt;BR /&gt;arcpy.SelectLayerByLocation_management(projectArea_Layer, "INTERSECT",arcpy.Geometry ("point", gcPoint, arcpy.Describe(projectArea).spatialReference),"","NEW_SELECTION")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:22:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231650#M8950</guid>
      <dc:creator>ShaunConway</dc:creator>
      <dc:date>2017-03-07T17:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Publish python script as geoprocessing service using a locator service</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231651#M8951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty spiffy! &amp;nbsp;Nicely done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 18:04:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231651#M8951</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2017-03-07T18:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Publish python script as geoprocessing service using a locator service</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231652#M8952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do the same thing. But I get a couple of errors. One being Key error: 'candidates' in PythonWin and the other is NameError: name 'urllib' is not defined when running tool in Arctoolbox. Any help is appreciated. I have been trying to perform this with request module and need to be able to input address each time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:51:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231652#M8952</guid>
      <dc:creator>MaryThomas</dc:creator>
      <dc:date>2017-10-17T11:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Publish python script as geoprocessing service using a locator service</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231653#M8953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try to print the response of the request prior to parsing it&amp;nbsp;or even accessing the text file generated to make sure that it contains the response you expect.&amp;nbsp; The urllib module is a default, standard library included with the installation of Python for Server and ArcMap.&amp;nbsp; You need to make sure you import the &lt;SPAN&gt;module&amp;nbsp;&lt;/SPAN&gt;prior to using it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 23:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publish-python-script-as-geoprocessing-service/m-p/231653#M8953</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2017-10-18T23:15:46Z</dc:date>
    </item>
  </channel>
</rss>

