<?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: Iterating through a feature class. in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627203#M20859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But I only have 1 feature class I'm working with. I'm trying to clip it into multiple feature classes. Sorry if I wasn't clear. Do I create a list of the one feature class and to a for loop to clip it to different layers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2015 13:41:48 GMT</pubDate>
    <dc:creator>DeidreA</dc:creator>
    <dc:date>2015-07-28T13:41:48Z</dc:date>
    <item>
      <title>Iterating through a feature class.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627200#M20856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a Python newbie, so forgive me if this question is pretty simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to iterate through a shapefile feature class. The shapefile contains a bunch of points that I'm trying to clip based on another layer. This is what the script looks like when I do it:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14380265826005497" data-renderedposition="134_8_912_16" jivemacro_uid="_14380265826005497" modifiedtitle="true"&gt;&lt;P&gt;arcpy.Clip_analysis('RF_Acreage', 'Lake_Ontario_Plains_FDRA_Boundary', r'L:\OPP\Rangers\Central Office\GIS\Deidre GIS Reporting Files\testmodel\Modeloutputs.zxgdb')&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works fine on it's own, but I need to do it for multiple regions. so it would be very tedious to clip one by one. So basically my input features will stay as 'RF_Acreage' while I clip it too different features.&lt;/P&gt;&lt;P&gt;Should I be using if statements and for loops? If so, how do I go about stringing these together?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully I'm making sense. Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 19:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627200#M20856</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2015-07-27T19:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a feature class.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627201#M20857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out the examples and documentation for &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/listfeatureclasses.htm"&gt;ListFeatureClasses&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, get the feature classes into a list, then loop through the list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 19:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627201#M20857</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-07-27T19:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a feature class.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627202#M20858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also make sure you are naming out of your output features a unique name, otherwise it will either crash or overwrite the features you are creating. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a relatively small number of features, it might be easier to run clip in batch mode rather than write out a script.&amp;nbsp; As long as you set parameters that stay the same before you add new rows in batch, it will keep the parameters the same for each row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 20:15:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627202#M20858</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-07-27T20:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a feature class.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627203#M20859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But I only have 1 feature class I'm working with. I'm trying to clip it into multiple feature classes. Sorry if I wasn't clear. Do I create a list of the one feature class and to a for loop to clip it to different layers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627203#M20859</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2015-07-28T13:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a feature class.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627204#M20860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would make a list of the feature class you want to clip with and leave the input the same for the 1 feature class you want clipped.&amp;nbsp; You would then loop through each of the feature classes you want to clip with and use each individual one as the clipping layer for the tool.&amp;nbsp; Your input would stay the same each time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 14:01:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627204#M20860</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-07-28T14:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a feature class.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627205#M20861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the suggestions posted so far and the example posted in the &lt;A href="http://resources.arcgis.com/EN/HELP/MAIN/10.2/0008/000800000004000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Clip Analysis Help&lt;/A&gt;​, you should be able to get started. Here's what the list and the for loop might look like...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;clip_features = [
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Lake_Ontario_Plains_FDRA_Boundary',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Another_FDRA_Boundary',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Some_FDRA_Boundary',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Other_FDRA_Boundary'
]

for fc in clip_features:
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_feature_class = in_features+fc&amp;nbsp; ## Naming is up to you
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis(in_features, fc, out_feature_class)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/iterating-through-a-feature-class/m-p/627205#M20861</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-12T02:43:36Z</dc:date>
    </item>
  </channel>
</rss>

