<?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 Selecting a Feature then Processing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128832#M9996</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a Python newbie, though have other programming experience.&amp;nbsp; I am looking to run through a set of features one at a time and process a union with another layer.&amp;nbsp; There are better than 1000 features, so automating this is the only practical way.&amp;nbsp; Can someone slip me some python code that would allow this, or point me to a better resource?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jan 2011 15:49:02 GMT</pubDate>
    <dc:creator>BradOleson</dc:creator>
    <dc:date>2011-01-10T15:49:02Z</dc:date>
    <item>
      <title>Selecting a Feature then Processing</title>
      <link>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128832#M9996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a Python newbie, though have other programming experience.&amp;nbsp; I am looking to run through a set of features one at a time and process a union with another layer.&amp;nbsp; There are better than 1000 features, so automating this is the only practical way.&amp;nbsp; Can someone slip me some python code that would allow this, or point me to a better resource?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 15:49:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128832#M9996</guid>
      <dc:creator>BradOleson</dc:creator>
      <dc:date>2011-01-10T15:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Feature then Processing</title>
      <link>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128833#M9997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well you want to iterate over the feature class using a cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
cursor=arcpy.SearchCursor(feature class path or layer object)
for feature in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; SelectLayerByAttribute(feature class, feature.OID)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Union(union params here)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats kinda meta but is the way i would do it. It will give you a feature class for every feature doing it this way so you would have 1000+ new feature classes. Could you copy all the features into one feature class and merge them? That would give you similar results without so much output. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Cursor/000v00000068000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Cursor/000v00000068000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128833#M9997</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2021-12-11T07:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Feature then Processing</title>
      <link>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128834#M9998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks!&amp;nbsp; I found a way in Model Builder to do what I was looking for, but your guidance likely will help in future needs as I will be porting my knowledge over to Python.&amp;nbsp; I appreciate your input!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brad&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 22:23:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128834#M9998</guid>
      <dc:creator>BradOleson</dc:creator>
      <dc:date>2011-01-13T22:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Feature then Processing</title>
      <link>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128835#M9999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Seeing a geoprocessing tool inside a cursor always gives me the shivers. This looks like reinventing GIS in a Python script with an unnecessary loop. Maybe like emptying the ocean with a thimble.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It surely will be very very slow calling union for a thousand separate features, and I have trouble understanding the need to do this. ArcGIS is a geo-relational system, at least it was before ArcObjects. The mindset is to find a tool that processes the whole dataset with an implied loop over the whole featureclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to think of a problem in the same way as an SQL query. You don't usually open a cursor there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the sources are suitably tagged, then a union between the two featureclasses will do all the unions in one step without a cursor.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jan 2011 07:40:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/selecting-a-feature-then-processing/m-p/128835#M9999</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2011-01-17T07:40:09Z</dc:date>
    </item>
  </channel>
</rss>

