<?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: Union analysis fails to execute in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472955#M36931</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;True. I am Info (advanced). Manually using the tool works fine, so error must be in the Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Sep 2012 14:00:38 GMT</pubDate>
    <dc:creator>RichardThurau</dc:creator>
    <dc:date>2012-09-14T14:00:38Z</dc:date>
    <item>
      <title>Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472953#M36929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anyone see what's causing this tool to fail?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Gridnums = range(1,18)

for i in Gridnums:
&amp;nbsp;&amp;nbsp;&amp;nbsp; #vis6class = ws + "/" + "TVvis6class_G" + str(i)
&amp;nbsp;&amp;nbsp;&amp;nbsp; inList = arcpy.ListFeatureClasses("*ProcGrid_"+str(i), "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "inList: " + str(inList)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Union_analysis(InList, ws + "/" + "TVvis6class_G" + str(i))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inList: [u'Road_ProcGrid_1', u'FPs_S_ProcGrid_1', u'er_di_ProcGrid_1', u'TV_v_ProcGrid_1']&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "E:\Projects\TV\01_Python\LandCover\LC_2_Vector_Tile_6class_091312.py", line 48, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Union_analysis([InList], ws + "/" + "TVvis6class_G" + str(i))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\analysis.py", line 483, in Union&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: Object: Error in executing tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's making a good list. I've tried messing with the output format.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions, much appreciated!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 03:51:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472953#M36929</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-09-14T03:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472954#M36930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Out of curiousity what license level are you running? and how many items are in &lt;/SPAN&gt;&lt;STRONG&gt;inList&lt;/STRONG&gt;&lt;SPAN&gt;?&amp;nbsp; If you are at anything below the ArcInfo (or perhaps advanced i think is the new terminology.. ?) I don't think the union tool accepts more than two inputs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 10:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472954#M36930</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-09-14T10:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472955#M36931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;True. I am Info (advanced). Manually using the tool works fine, so error must be in the Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 14:00:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472955#M36931</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-09-14T14:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472956#M36932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I suspect they way the output is being created is your problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;ws + "/" + "TVvis6class_G" + str(i))&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;See if you can enclose that entire term inside double quotes and see if that works out. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So something like this might be what it looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;"'" + ws + "/" + "TVvis6class_G" + str(i)) + "'"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 14:46:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472956#M36932</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-09-14T14:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472957#M36933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No Dice. Took a while to get back to this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another one of these cases where a lot of people are looking but no one has any suggestions? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something so fundamentally wrong that folks think it's hopeless?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way to line this up that makes sense?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this really something that shouldn't be going wrong, but is?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to post more info? The error code is exceptionally meaningless in this case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really don't want to revert to using ArcToolbox. Please, please!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Current code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for i in Gridnums:
&amp;nbsp;&amp;nbsp;&amp;nbsp; vis6classi = "'" + ws + "/" + "TVvis6class_G" + str(i) + "i" + "'"
&amp;nbsp;&amp;nbsp;&amp;nbsp; inList = arcpy.ListFeatureClasses("*ProcGrid_"+str(i), "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "inList: " + str(inList)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Union_analysis(InList, vis6classi)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Union completed for Grid " + str(i)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;same error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:54:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472957#M36933</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2021-12-11T20:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472958#M36934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please do print the variable &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;vis6classi&lt;/SPAN&gt;&lt;SPAN&gt; and take a look what it currently contains. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My guess would be that it is pointing to a location/workspace that isn't correctly formulated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are able to post your complete script or a more extended section showing where the workspace originates that would be great.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Thomas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 22:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472958#M36934</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2012-09-14T22:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472959#M36935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Turns out I had an empty geography as one of my union inputs. When I tested the tool, it was within a study site where the geography had data. The first union the code was calling was using a dataset that had no data in the analysis area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 23:06:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472959#M36935</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-09-17T23:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472960#M36936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't you just hate that?&amp;nbsp; Glad you found the error!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 11:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472960#M36936</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-09-18T11:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472961#M36937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am getting the exact same error, but my input is just one feature class (in order to find overlapping regions). It is called within a Python Toolbox workflow, and consistently throws this error. When I run it outside the tool run session, it works fine. Maddening. Any clues as to what might be going on?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 22:01:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472961#M36937</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-04-02T22:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472962#M36938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just solved it. I never had this issue before, but perhaps this is a new limitation in 10.1? The input parameter to Union must be a list, at least in my case. I put the single input into a list, i.e. &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.Union_analysis([input], output)&lt;/PRE&gt;&lt;SPAN&gt; and my tool runs smoothly. If this is a hard rule, it should be emphasized in the tool help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 16:22:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472962#M36938</guid>
      <dc:creator>JamieKass</dc:creator>
      <dc:date>2013-04-03T16:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472963#M36939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading help on the union command (v10.1 &lt;A href="http://resources.arcgis.com/EN/HELP/MAIN/10.1/index.html#//00080000000s000000" title="http://resources.arcgis.com/EN/HELP/MAIN/10.1/index.html#//00080000000s000000"&gt;ArcGIS Help 10.1&lt;/A&gt; )&amp;nbsp; it does say that the input features argument is a list, and shows the proper formatting as a Python list which is enclosed in square brackets - this is also true of v10.0.&amp;nbsp; This is confusing somewhat because the way this is depicted in the help doc is somewhat ambiguous. Help for earlier versions of ArcGIS (v9.3 &lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=union_(analysis)" title="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=union_(analysis)"&gt;ArcGIS Desktop Help 9.3 - union (analysis)&lt;/A&gt; ) also speak of the input_features argument as being a list but doesn't appear to require this to be formatted as a Python list - makes me think that the tool had a process working in the background to create a Python list from the user supplied input. Ultimately its better that the language in the tools and help are more aligned with the Python terminology so when reference is made to a list it is truly meant to a Python list which has a specific meaning when scripting the command, but it would be nice if this was more clearly stated for those who have worked with legacy products.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2015 11:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472963#M36939</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2015-09-28T11:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Union analysis fails to execute</title>
      <link>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472964#M36940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing that I would advise, in case there is any doubt about how the parameters should be provided, is to execute the tool manually and copy the python code from the Results window. This shows how the parameters should be provided. In case you feel that the help does not reflect clearly how things the tool should be used, you can use the "Feedback on this topic" link in the lower right part of the &lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/analysis-toolbox/union.htm"&gt;Help topic&lt;/A&gt;. I have used it several times and Esri has responded very fast (mostly the same day).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2015 12:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/union-analysis-fails-to-execute/m-p/472964#M36940</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-09-28T12:04:27Z</dc:date>
    </item>
  </channel>
</rss>

