<?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: Trouble using Merge in arcpy - only one featureclass (out of 8) being output after merge in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320976#M24971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I have this exact same problem and it's getting really frustrating troubleshooting something that should be so basic. Do you remember if this was ever solved? Any other ideas&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌? It only includes one feature class in the merge output in both ArcGIS Pro and ArcMap.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Oct 2019 16:16:37 GMT</pubDate>
    <dc:creator>Justin_P</dc:creator>
    <dc:date>2019-10-28T16:16:37Z</dc:date>
    <item>
      <title>Trouble using Merge in arcpy - only one featureclass (out of 8) being output after merge</title>
      <link>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320972#M24967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm attempting to use the merge function arcpy.management.Merge(inputs, output) but I am not getting the results I expect. I have a list of featureclasses (all polygon, all have the same fields) in the in_memory workspace:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;['in_memory\\polygon_D0511', 'in_memory\\polygon_D0510', 'in_memory\\polygon_D0512', 'in_memory\\polygon_D3239', 'in_memory\\polygon_D0514', 'in_memory\\polygon_D0515', 'in_memory\\polygon_D0513', 'in_memory\\polygon_D0509']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I am using that as my inputs. The output is in a local geodatabase. When I run the merge tool in the script, my output only contains the feature from&amp;nbsp;&lt;SPAN&gt;'in_memory\\polygon_D3239', and nothing else. I've looked in my in_memory workspace using the arcpy.ListFeatureClasses() function and found that all featureclasses listed are there. I'm at a loss.. can anybody shed some light on this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much for any help at all!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hannes&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:22:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320972#M24967</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-06-30T19:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Merge in arcpy - only one featureclass (out of 8) being output after merge</title>
      <link>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320973#M24968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run the merge tool manually, then go to the &lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/using-the-results-window.htm"&gt;Results window &lt;/A&gt;&lt;/STRONG&gt;and check the syntax etc if the manual method works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:30:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320973#M24968</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-06-30T19:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Merge in arcpy - only one featureclass (out of 8) being output after merge</title>
      <link>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320974#M24969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan, thank you&amp;nbsp;for the suggestion. I tried this after changing my script to save to a file geodatabase (instead of the in_memory workspace) and the merge worked just fine. However, attempting to do this same operation in script did not work even when using a file geodatabase instead of&amp;nbsp;the in_memory workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the merge tool documentation I can see that the input should be&amp;nbsp;a list of data filepaths, which is exactly what I am using for the input. The following code snippet is essentially* what I am doing in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;damarea = "C:\\temp.gdb&lt;/P&gt;&lt;P&gt;damarea_list = ['in_memory\\polygon_D0511', 'in_memory\\polygon_D0510', 'in_memory\\polygon_D0512', 'in_memory\\polygon_D3239', 'in_memory\\polygon_D0514', 'in_memory\\polygon_D0515', 'in_memory\\polygon_D0513', 'in_memory\\polygon_D0509']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "in_memory"&lt;/P&gt;&lt;P&gt;arcpy.management.Merge(damarea_list, damarea)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*I am leaving out a for loop where I first develop the individual featureclasses and then append them to the final list that you see in damarea_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field mapping parameter is optional and since all input featureclasses have the exact same fields, I do not think I need it for the merge tool to work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I did see that when I export to python from model builder, the input featureclasses is not provided as a list, but as a string with filepaths separated by a semicolon (;). I tried this in the script and it also did not work. Any other ideas?? I am at a loss and appreciate any help I can get here.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 14:36:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320974#M24969</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-07-05T14:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Merge in arcpy - only one featureclass (out of 8) being output after merge</title>
      <link>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320975#M24970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The parameters would be a semi-colon list of strings, but you parse the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a_list &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"some;big;long;string;of;files"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;";"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

a_list
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'some'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'big'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'long'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'string'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'of'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'files'&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am not convinced that the inmemory workspace is the best for this.&amp;nbsp; If saving to a geodatabase worked, keep using it, do the merge there and use Copy tool to copy/move the results to its ultimate destination, then Delete the temporary geodatabase.... something about the double-backslashes is ringing a bell... try single then abandon in_memory if that doesn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320975#M24970</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T15:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble using Merge in arcpy - only one featureclass (out of 8) being output after merge</title>
      <link>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320976#M24971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I have this exact same problem and it's getting really frustrating troubleshooting something that should be so basic. Do you remember if this was ever solved? Any other ideas&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌? It only includes one feature class in the merge output in both ArcGIS Pro and ArcMap.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2019 16:16:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trouble-using-merge-in-arcpy-only-one-featureclass/m-p/320976#M24971</guid>
      <dc:creator>Justin_P</dc:creator>
      <dc:date>2019-10-28T16:16:37Z</dc:date>
    </item>
  </channel>
</rss>

