1

I have two layers, each contain hundreds of polygons. I'm trying to find a way to clip the data from one layer to each polygon of the other layer. The problem is the clip features of the layer overlap. I would like the input layer to be clipped to each polygon separately and create duplicated in the overlapping areas. Is there an easy way of clipping the input layer to each polygon of the second layer separately? Unfortunately I'm not familiar with coding if that's an option.

  • 1
    Do you want a separate output feature class for each clip? – BERA Feb 20 '17 at 13:00
  • 1
    Intersect them and dissolve by 2 attributes being unique IDs – FelixIP Feb 20 '17 at 18:34
  • Ah, I had forgotten about intersect. That seems to be the easiest option! thanks! – May Feb 21 '17 at 13:53
0

Since you don't want a coding solution, I have a modelbuilder solution:

  1. Create a new model
  2. Add you input layer and your clipping layer
  3. Right click in the model and select iterators>feature selection
  4. Connect the clipping layer to the iterator and set the group by field if you need to group by a field
  5. Add the clip tool and connect the output of the iterator to the clip tool as the clipping features
  6. Connect the input layer to the clip tool as the input features
  7. Open the clip tool properties and change the output path to YourTextHere_%Value% - this will output YourTextHere_(attribute value of selected feature) e.g. Properties_131

In the picture below, you can see the model set up, clip settings and example outputs from the model: enter image description here

-1

Script below will clip an input feature class with each polygon from a clip feature class and create a new feature class for each clip. The output feature classes will be named 'Clip_'+objectid, for example Clip_1

import arcpy,os

fc_to_clip=r'C:\TEST.gdb\polygons123'
clipfeatures=r'C:\TEST.gdb\clip_features'
out_location=r'C:\TEST.gdb'

with arcpy.da.SearchCursor(clipfeatures,['OBJECTID','SHAPE@']) as cursor:
    for row in cursor:
        arcpy.Clip_analysis(in_features=fc_to_clip, clip_features=row[1],out_feature_class=os.path.join(out_location,'Clip_'+str(row[0])))

Save the code as a .py file and execute in Python Window (section Loading Python into the Python window)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.