<?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: Geoprocessing Script to Clip based on Two Attributes in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53306#M4236</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Wes.&amp;nbsp; I get the following error when I run the script. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/121432_error.JPG" style="width: 620px; height: 525px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Aug 2015 23:12:11 GMT</pubDate>
    <dc:creator>JasonFultz</dc:creator>
    <dc:date>2015-08-07T23:12:11Z</dc:date>
    <item>
      <title>Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53296#M4226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a method to do a clip based on two attributes.&amp;nbsp; In the attached shapefile, I have a "Year" field with years ranging from 0 to 27 and a "COLOR" field populated with either Red or Green.&amp;nbsp; I am looking for the best way to cycle through each year and clip the Red polygons from the Green polygons (discarding the area that intersects).&amp;nbsp; Is a python script or iterative model the best approach for this?&amp;nbsp; I am still a novice python user but very interested in learning more about it.&amp;nbsp; Any help with this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Attribute_Screenshot.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/120583_Attribute_Screenshot.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 13:38:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53296#M4226</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-04T13:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53297#M4227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script below should get you started. Open a new arcmap and add your Topsoil layer open your arcmap python window right click behind the "&amp;gt;&amp;gt;&amp;gt;" and select load and load this script hit enter and watch it run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy,os


arcpy.env.overwriteOutput = True
fc ="Topsoil"
y = 28
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;out_path = "in_memory"&lt;/SPAN&gt;
"""
#Create results featureclass

results = "results"
arcpy.CreateFeatureclass_management(out_path,results,"POLYGON",fc)
"""


for i in range(y):
&amp;nbsp;&amp;nbsp;&amp;nbsp; greenquery = '"COLOR" =' + "'Green'"
&amp;nbsp;&amp;nbsp;&amp;nbsp; redquery = '"COLOR" =' + "'Red'"
&amp;nbsp;&amp;nbsp;&amp;nbsp; value = str(i)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(value) == 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = "0" + value
&amp;nbsp;&amp;nbsp;&amp;nbsp; value = "Y"+value
&amp;nbsp;&amp;nbsp;&amp;nbsp; yearquery = '"Year" ='+ "'%s'"%(value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Rquery = yearquery + "AND" + redquery
&amp;nbsp;&amp;nbsp;&amp;nbsp; Gquery = yearquery + "AND" + greenquery
&amp;nbsp;&amp;nbsp;&amp;nbsp; redLayer = "Red" + value
&amp;nbsp;&amp;nbsp;&amp;nbsp; greenLayer = "Green" + value
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Create red layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fc,redLayer,Rquery)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Create green layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fc,greenLayer,Gquery)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print int(arcpy.GetCount_management(redLayer).getOutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; if int(arcpy.GetCount_management(redLayer).getOutput(0)) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #do the clip
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #print value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clip = "clip"+value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_analysis(greenLayer,redLayer,os.path.join(out_path,clip))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:03:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53297#M4227</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-10T22:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53298#M4228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jason,&lt;/P&gt;&lt;P&gt;You could also try this. I could call it a LAYMAN method.&lt;/P&gt;&lt;P&gt;1) Use Geoprocessing &amp;gt; Union tool to delineate the boundaries.&lt;/P&gt;&lt;P&gt;2) From the ouput layer from UNION, convert &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000003m000000"&gt;feature to point&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;3) Start editing. From the points layer, select (by attribute) the points where &lt;EM&gt;[COLOR]= "Red"&lt;/EM&gt; and delete them. Save edits.&lt;/P&gt;&lt;P&gt;4) Then go for a Select by Location where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Target Layer: Union_output (polygon)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Source Layer: Point_layer (point)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spatial Selection Method: Contain the source layer feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete the selected features (These are the overlapping features). Save edits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) In the Union_Output layer, Select (by attribute) the polygons where &lt;EM&gt;[COLOR]= "Red" &lt;/EM&gt;and delete them. Save and stop editing.&lt;/P&gt;&lt;P&gt;The Union_Output will now contain the features where [COLOR]="Red".&lt;/P&gt;&lt;P&gt;6) &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000005r000000"&gt;Dissolve&lt;/A&gt; the above layer based on [YEAR] and [COLOR] (Choosing the [COLOR] field is optional, since all the features in this layer are red).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 19:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53298#M4228</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2015-08-04T19:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53299#M4229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wes, Thank you very much for the reply and for providing the script.&amp;nbsp; I'm afraid I'm going to show how much of a true Python novice I am by asking if there is a way to save this script that you supplied? I am unable to import it into Python window without it being saved as a .py file.&amp;nbsp; Is there a way to save if from GeoNet as a .py file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 21:38:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53299#M4229</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-04T21:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53300#M4230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an alternative way to get to your answer, using arcpy geometry objects, directly:&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; dict = {}
... with arcpy.da.SearchCursor("Topsoil",["SHAPE@","COLOR","Year"]) as cursor: # loop through the topsoil feature class
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[2] in dict:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[1] in dict[row[2]]:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dict[row[2]][row[1]] = row[0].union(dict[row[2]][row[1]]) # combine all the reds and greens for that year
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dict[row[2]][row[1]] = row[0]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dict[row[2]] = {row[1]:row[0]}
... arcpy.CopyFeatures_management("Topsoil",r'in_memory\newPolys') # copy schema + features
... arcpy.DeleteFeatures_management(r'in_memory\newPolys') # delete features
... insCursor = arcpy.da.InsertCursor(r'in_memory\newPolys',["SHAPE@","Year"]) # get ready to write
... for year in dict: # loop through dictionary
...&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(dict[year]) == 2: # does it have red AND green?
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newPoly = dict[year]['Green'].difference(dict[year]['Red']) # subtract red from green
...&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newPoly = dict[year]['Green'] # write the green poly if there is no red
...&amp;nbsp;&amp;nbsp;&amp;nbsp; insCursor.insertRow([newPoly,year]) # insert the polygon&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53300#M4230</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-10T22:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53301#M4231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Highlight the code press "ctrl" key and the "c" together or with the code highlighted right click and select copy. Then open the python IDLE and under "File" select "New Window" and click in the new window and press "ctrl" and "v" key together or right click and select paste then save the code to a location and make sure to give a meaningful name ( a name that will tell you what the code is) and end it with ".py" you'll then be able to add to your arcmap python window&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 19:05:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53301#M4231</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-05T19:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53302#M4232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I tried this method, I received the following error in the screenshot.&amp;nbsp; I copied/pasted it into the python IDLE and saved it as a .py.&amp;nbsp; I then loaded it into the python window in ArcGIS and received the following syntax error.&amp;nbsp; I feel its because the method of copy/paste.&amp;nbsp; I would guess that the syntax error is because of the numbers getting copied over as well.&amp;nbsp; Any thoughts?&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Python.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/121245_Python.JPG" style="width: 620px; height: 561px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 13:45:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53302#M4232</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-06T13:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53303#M4233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, Thank you Jayanta.&amp;nbsp; I will give this a try.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 13:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53303#M4233</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-06T13:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53304#M4234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for providing this, Darren.&amp;nbsp; I will give it a try. As I mentioned above, I seem to be having issues saving a script from GeoNet and running it in IDLE or the ArcGIS Python window.&amp;nbsp;&amp;nbsp; Any idea how to best save this without the row numbers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 13:52:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53304#M4234</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-06T13:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53305#M4235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code is attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 15:05:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53305#M4235</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-06T15:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53306#M4236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Wes.&amp;nbsp; I get the following error when I run the script. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/121432_error.JPG" style="width: 620px; height: 525px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 23:12:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53306#M4236</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-07T23:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53307#M4237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, try this one. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Aug 2015 18:31:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53307#M4237</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-08T18:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53308#M4238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gave this script a try but received an error stating "Empty Output Generated".&amp;nbsp;&amp;nbsp; Would it have stopped because Year 00 only has a green polygon, and not a red polygon, so no clipping would be necessary for Y00?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/122039_error.png" style="width: 620px; height: 302px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:36:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53308#M4238</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-12T13:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53309#M4239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Wes.&amp;nbsp; This script ran fine, but it made me realize I perhaps want to do an Erase rather than a Clip.&amp;nbsp; I believe I described this task incorrectly when I first posted, my apologies.&amp;nbsp; I am looking to eliminate the overlap between the red and green polygons for each year. Although I would like to still keep both the red and green polygons for each year, just eliminate any overlap between them. I can try to modify the script you provided to run an Erase instead of Clip.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have one more question.&amp;nbsp; I noticed that when I ran the latest script you provided, it produced a new shapefile for each color for each year (screenshot below).&amp;nbsp; Ideally, I would like to end up with one shapefile that contains all polys, which still maintains year and color, only with the red/green overlap erased by year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help you have given me with this task. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture1.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/122040_Capture1.JPG" style="width: 620px; height: 671px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 14:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53309#M4239</guid>
      <dc:creator>JasonFultz</dc:creator>
      <dc:date>2015-08-12T14:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Script to Clip based on Two Attributes</title>
      <link>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53310#M4240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason the script creates 3 files for every year that has features with red. If I remember correctly Y00 and Y01 didn't have any red features to use. I think if you check just those years that begin with clip they may be what you are describing. If that is the case you just need to generate a list and feed it into the merge tool &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000055000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000055000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 14:38:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/geoprocessing-script-to-clip-based-on-two/m-p/53310#M4240</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-08-12T14:38:59Z</dc:date>
    </item>
  </channel>
</rss>

