<?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: Clipping to multiple polygons? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71582#M5890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help! Also, how do I go about incorporating naming each new output in my python script? Here is what I have now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy
&amp;gt;&amp;gt;&amp;gt; from arcpy import env
&amp;gt;&amp;gt;&amp;gt; env = "L:/OPP/Rangers/Central Office/GIS/Deidre GIS Reporting Files"
&amp;gt;&amp;gt;&amp;gt; inFeatures = 'Wildfires'
&amp;gt;&amp;gt;&amp;gt; FDRABoundaries = ['Catskill_FDRA_Boundary', 'Long_Island_FDRA_Boundary', 'Leatherstocking_FDRA_Boundary', 'St_Lawrence_FDRA_Boundary', 'Southern_Tier_FDRA_Boundary', 'UHC_FDRA_Boundary', 'Lake_Ontario_Plains_FDRA_Boundary', 'HudsonValley_FDRA_Boundary', 'ADK_HighPeaks_FDRA_Boundary', 'ADK_FDRA_Boundary']
&amp;gt;&amp;gt;&amp;gt; xy_tolerance = ""
&amp;gt;&amp;gt;&amp;gt; for boundary in FDRABoundaries: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis('Wildfires', boundary, xy_tolerance)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script seems to be running fine now thanks to that fix! I initially put the FDRA variable as a name for the output, but I see now that was wrong. How should I change the script so that I can assign proper output names for each clip? I ran the script as is above and it's working fine but the names of the output are "Wildfires_Clip1, Wildfires_Clip2..." and so on. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:45:56 GMT</pubDate>
    <dc:creator>DeidreA</dc:creator>
    <dc:date>2021-12-10T22:45:56Z</dc:date>
    <item>
      <title>Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71580#M5888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone! Right now I'm trying to clip a point shape file to 9 different polygon feature classes. I've come up with this script, but it's not working for me for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wildfires is the point shapefile and the boundaries are all polygons I'm trying to clip the point shapefile to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
&amp;gt;&amp;gt;&amp;gt; from arcpy import env
&amp;gt;&amp;gt;&amp;gt; env.workspace = "L:/OPP/Rangers/Central Office/GIS/Deidre GIS Reporting Files"
&amp;gt;&amp;gt;&amp;gt; FDRA_Boundary = ['Catskill_FDRA_Boundary', 'Long_Island_FDRA_Boundary', 'Leatherstocking_FDRA_Boundary', 'St_Lawrence_FDRA_Boundary', 'Southern_Tier_FDRA_Boundary', 'UHC_FDRA_Boundary', 'Lake_Ontario_Plains_FDRA_Boundary', 'HudsonValley_FDRA_Boundary', 'ADK_HighPeaks_FDRA_Boundary', 'ADK_FDRA_Boundary']
&amp;gt;&amp;gt;&amp;gt; for boundary in FDRA_Boundary:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis('Wildfires', FDRA_Boundary, FDRA)
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Forgive me if this is a simple question. I'm still trying to incorporate basic python into my workflow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71580#M5888</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2021-12-10T22:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71581#M5889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deidre,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;simple fix, you need to replace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.Clip_analysis(&lt;SPAN class="string"&gt;'Wildfires'&lt;/SPAN&gt;, FDRA_Boundary, FDRA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.Clip_analysis(&lt;SPAN class="string"&gt;'Wildfires'&lt;/SPAN&gt;, boundary, FDRA)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FDRA_Boundary is a list, which is not a valid input for the tool, whereas boundary is the place holder for the item in the list you are looping through(shapefile or GDB FC, first time through this would be &lt;SPAN class="string"&gt;'Catskill_FDRA_Boundary', and so on and so forth&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also notice you are not defining FDRA variable, you will need to do this, and name each output from clip analysis uniquely, or it will overwrite the output of each clip, since they will have the same name and filepath.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if your files are shapefiles(since I don't see a gdb in your file path thought they might be), you will want to add .shp to each filename in the FDRA_Boundary list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Okay maybe not so simple since there are a couple things wrong, but you are on the right track.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 18:14:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71581#M5889</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-09-11T18:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71582#M5890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help! Also, how do I go about incorporating naming each new output in my python script? Here is what I have now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy
&amp;gt;&amp;gt;&amp;gt; from arcpy import env
&amp;gt;&amp;gt;&amp;gt; env = "L:/OPP/Rangers/Central Office/GIS/Deidre GIS Reporting Files"
&amp;gt;&amp;gt;&amp;gt; inFeatures = 'Wildfires'
&amp;gt;&amp;gt;&amp;gt; FDRABoundaries = ['Catskill_FDRA_Boundary', 'Long_Island_FDRA_Boundary', 'Leatherstocking_FDRA_Boundary', 'St_Lawrence_FDRA_Boundary', 'Southern_Tier_FDRA_Boundary', 'UHC_FDRA_Boundary', 'Lake_Ontario_Plains_FDRA_Boundary', 'HudsonValley_FDRA_Boundary', 'ADK_HighPeaks_FDRA_Boundary', 'ADK_FDRA_Boundary']
&amp;gt;&amp;gt;&amp;gt; xy_tolerance = ""
&amp;gt;&amp;gt;&amp;gt; for boundary in FDRABoundaries: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis('Wildfires', boundary, xy_tolerance)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script seems to be running fine now thanks to that fix! I initially put the FDRA variable as a name for the output, but I see now that was wrong. How should I change the script so that I can assign proper output names for each clip? I ran the script as is above and it's working fine but the names of the output are "Wildfires_Clip1, Wildfires_Clip2..." and so on. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:45:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71582#M5890</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2021-12-10T22:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71583#M5891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;"&gt;The arguments for Clip are:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;"&gt;Clip_analysis (in_features, clip_features, out_feature_class, {cluster_tolerance})&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So, in_features is first, clip_features second, out_feature_class third.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to name your output feature class with a variable, you need to use it in the third position.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14419964708972597 jive_text_macro" data-renderedposition="170_8_912_16" jivemacro_uid="_14419964708972597"&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;arcpy.Clip_analysis(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue; background-color: #f6f6f6;"&gt;'Wildfires'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;, boundary, boundary + "_clip") # or something&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: setting something to "env" doesn't do anything, as far as I know. Well, actually it sets the thing that used to be the environment object (as imported) to a string equal to your specified path. If you intend to set the workspace environment, you need to call it&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14419965745449183 jive_text_macro" data-renderedposition="249_8_912_16" jivemacro_uid="_14419965745449183"&gt;&lt;P&gt;env.workspace =&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue;"&gt;"L:/OPP/Rangers/Central Office/GIS/Deidre GIS Reporting Files"&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 18:35:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71583#M5891</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-09-11T18:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71584#M5892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Couple of ways though I think for your purpose, incorporating the original file name to the new file would be best to easily identify the new output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;for&lt;/SPAN&gt; boundary &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; FDRABoundaries:&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis(&lt;SPAN class="string"&gt;'Wildfires', boundary, boundary + "_Clip" ,&amp;nbsp; xy_tolerance)&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN class="string"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;Would use the input file name and then add "_Clip" to the end of it for the output name.&amp;nbsp; That way you know which dataset was used for the clip.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;Also xy_tolerance(aka cluster_tolerance) is the 4th parameter for this tool, not the third.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;See &lt;A href="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//000800000004000000" title="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//000800000004000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 18:37:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71584#M5892</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-09-11T18:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71585#M5893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, that was just an error do to rushing on my part. Thank you for pointing it out and thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 18:42:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71585#M5893</guid>
      <dc:creator>DeidreA</dc:creator>
      <dc:date>2015-09-11T18:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping to multiple polygons?</title>
      <link>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71586#M5894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whoops I missed the lack of env.workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, we have to stop posting the almost same responses &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 18:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/clipping-to-multiple-polygons/m-p/71586#M5894</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-09-11T18:45:02Z</dc:date>
    </item>
  </channel>
</rss>

