<?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 Feature Set parameter in a tool destined to be a gp service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276763#M21358</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm converting some 10.0 python code into a 10.1 python toolbox. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One of my parameters is a Feature Set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in my 10.0 code if i run this in arcmap i get the interactive buttons to digitize a shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in 10.1 i don't get this option. i just get the layers in the map or a folder icon to load other layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think this has something to do with the schema. this is an input parameter. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in 10.0 world i would have used catalog to point this tool at a dummy schema just to get it stubbed out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 10.1 i think it is supposed to work differently but i can't figure it out and i don't see enough in the docs to help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;there is alot of stuff in the docs about schema for output fs params, mine is input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i want to serve this script as a gp tool in ags. the app would upload features in a format that the fs param can understand.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i saw something in the doc about needing geometryType and fieldRule params but i could use a working code sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here is what i have thus far (this is in a python toolbox):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;class TestTool(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.label = "TestTool"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.description = "TestTool"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.canRunInBackground = False

&amp;nbsp;&amp;nbsp;&amp;nbsp; def getParameterInfo(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Feature Set you pick a layer or load a layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param0 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="aFeatureSet",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="aFeatureSet",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="Feature Set",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Required",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Input")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #param0.value = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="aString",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="aString",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="String",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Required",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Input")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1.value = ""


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params = [param0, param1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return params

&amp;nbsp;&amp;nbsp;&amp;nbsp; def isLicensed(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True

&amp;nbsp;&amp;nbsp;&amp;nbsp; def updateParameters(self, parameters):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return

&amp;nbsp;&amp;nbsp;&amp;nbsp; def updateMessages(self, parameters):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return

&amp;nbsp;&amp;nbsp;&amp;nbsp; def execute(self, parameters, messages):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #do stuff&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2012 20:36:14 GMT</pubDate>
    <dc:creator>KevinGooss</dc:creator>
    <dc:date>2012-10-25T20:36:14Z</dc:date>
    <item>
      <title>Feature Set parameter in a tool destined to be a gp service</title>
      <link>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276763#M21358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm converting some 10.0 python code into a 10.1 python toolbox. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One of my parameters is a Feature Set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in my 10.0 code if i run this in arcmap i get the interactive buttons to digitize a shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in 10.1 i don't get this option. i just get the layers in the map or a folder icon to load other layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think this has something to do with the schema. this is an input parameter. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in 10.0 world i would have used catalog to point this tool at a dummy schema just to get it stubbed out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 10.1 i think it is supposed to work differently but i can't figure it out and i don't see enough in the docs to help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;there is alot of stuff in the docs about schema for output fs params, mine is input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i want to serve this script as a gp tool in ags. the app would upload features in a format that the fs param can understand.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i saw something in the doc about needing geometryType and fieldRule params but i could use a working code sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here is what i have thus far (this is in a python toolbox):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;class TestTool(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.label = "TestTool"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.description = "TestTool"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.canRunInBackground = False

&amp;nbsp;&amp;nbsp;&amp;nbsp; def getParameterInfo(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Feature Set you pick a layer or load a layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param0 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="aFeatureSet",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="aFeatureSet",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="Feature Set",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Required",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Input")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #param0.value = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="aString",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="aString",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="String",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Required",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Input")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1.value = ""


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params = [param0, param1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return params

&amp;nbsp;&amp;nbsp;&amp;nbsp; def isLicensed(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True

&amp;nbsp;&amp;nbsp;&amp;nbsp; def updateParameters(self, parameters):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return

&amp;nbsp;&amp;nbsp;&amp;nbsp; def updateMessages(self, parameters):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return

&amp;nbsp;&amp;nbsp;&amp;nbsp; def execute(self, parameters, messages):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #do stuff&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 20:36:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276763#M21358</guid>
      <dc:creator>KevinGooss</dc:creator>
      <dc:date>2012-10-25T20:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Set parameter in a tool destined to be a gp service</title>
      <link>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276764#M21359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Almost there....just need to assign the template to the value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Feature Set you pick a layer or load a layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param0 = arcpy.Parameter(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; displayName="aFeatureSet",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="aFeatureSet",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatype="Feature Set",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameterType="Required",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; direction="Input")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param0.value = "c:\\mytemplates\\line.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #or
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #param0.value =&amp;nbsp; os.path.join(os.path.dirname(__file__), "f.gdb\\line")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276764#M21359</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2021-12-11T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Set parameter in a tool destined to be a gp service</title>
      <link>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276765#M21360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just noticed that in the docs after i posted. I used a lyr file and now in arcmap i do see the new feature template so i am able to digitize in arcmap, so that's cool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but when i publish the tool and send it a feature via the rest interface i get an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Unable to complete operation.&lt;BR /&gt;The workspace is not connected.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really don't need any of the schema i'm simply sending in coordinate sets for a polygon. I'm using that in the tool to do an intersection and then return a specific string out of the tool. Is the feature set overkill for what i need?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm publishing from my ags web manager machine over to my ArcServer machine by creating a disconnected sd file. Maybe something isn't being copied during the publish process properly?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 22:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276765#M21360</guid>
      <dc:creator>KevinGooss</dc:creator>
      <dc:date>2012-10-25T22:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Set parameter in a tool destined to be a gp service</title>
      <link>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276766#M21361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well a featureset takes a certain input. So I'd use whatever you have your coordinates in. If thats something which featureset can read, then go with that. If its a "string", like [[2,2], [5,5]] then use the string control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I sort of understand what you're doing, but without the complete picture I can't offer a "best suggestion". My guess though is you probably have formatted json that you're passing in so you should be using the featureset control?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 23:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276766#M21361</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-10-25T23:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Set parameter in a tool destined to be a gp service</title>
      <link>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276767#M21362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yeah, its json that the js api creates when a user digitizes within my app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now that the rest endpoint has the schema (via the value in python) it fills in all of that for me when i go to the execute method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it leaves the features as a [] so that i can drop my geometry representation in there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't put in any attributes because this is just a sketch the user makes and the script is to validate that the geometry is acceptable before dumping it in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I suppose i could trim my schema down to have the bare attributes rather than those of the target feature class that the feature is destined for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll give that a try and see how it shakes out. I'm not interested in attributes for this gp tool, just want the geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2012 12:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/feature-set-parameter-in-a-tool-destined-to-be-a/m-p/276767#M21362</guid>
      <dc:creator>KevinGooss</dc:creator>
      <dc:date>2012-10-26T12:57:57Z</dc:date>
    </item>
  </channel>
</rss>

