Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 100 different input vector layers and one clip feature vector layer.

I have to clip them 100 times but its a large amount of work.

Is there any Python script (ArcPy) in ArcGIS for Desktop to accelerate my work and avoid the one by one clipping?

share|improve this question
This Q could be merged with…; well the answers could be merged, the Q's come from different places. ;-) – matt wilkie Jan 29 '15 at 22:49

You can use a simple block of code either directly from Python window in ArcGIS or as a Python script or as a custom script tool.

Below is a sample code for a script tool. Just add your vector layers into a map document (.mxd) and specify the clip layer and the output geodatabase.

import os, arcpy
arcpy.env.overwriteOutput = True

clip_layer = arcpy.GetParameterAsText(0)
out_gdb = arcpy.GetParameterAsText(1)

mxd_obj = arcpy.mapping.MapDocument("CURRENT")

for lyr in arcpy.mapping.ListLayers(mxd_obj):
    out_layer = os.path.join(out_gdb,
share|improve this answer
Thank you Alex, this was the essential kickstart I needed for ArcGIS desktop map package, with clipping. – matt wilkie Feb 26 '15 at 19:22
@mattwilkie, glad my work helped someone, this is probably the very argument for me to be around on GIS.SE :) – Alex Tereshenkov Feb 27 '15 at 5:43

In you case (only one tool), you can simply right click on the clip tool in your toolbox, and launch it as a "batch". See the ArcGIS help for more details

share|improve this answer

You can place all the feature classes within a single dataset then use model builder to clip all at once and output to a new dataset: enter image description here enter image description here

share|improve this answer
The images are nice for instant recognition, "yes, I'm in the right place". The parameters would benefit from being reiterated in the answer body as text; they're almost too small to read. – matt wilkie Jan 29 '15 at 23:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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