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

Hi friends: i have some feature class(7 feature classes) and I want to batch buffer in ArcGIS 10 . I don't know how can I buffer at once. Please help me.


share|improve this question
Remember that arcpy does not handle memory issues very well. If you have big tasks (complex/many features) you might end up with the message: "There is not enough memory." – ragnvald Oct 2 '12 at 11:08
up vote 5 down vote accepted

To buffer several features, you need to use some control structure. A technique I have found very useful is to store all of the shapefiles you are using in one folder, then loop through everything that is a shapefile. I do this using the glob module, as follows:

# import modules
import arcpy, glob

# folder where shapefiles are stored
folder = 'C:/myfiles/'

# loop through all shapefiles
for shapefile in glob.glob( folder + '*.shp' ):
     arcpy.Buffer_analysis( shapefile, "C:/output/" + shapefile[-8:-4] + "buffer.shp" "100 Feet", "FULL", "ROUND", "LIST", "Distance")

(See ArcGIS help here for more details)

I'm using an awkward way of naming the buffered file here (shapefile[-8:-4]); a better way is to set the workspace using something like arcpy.env.workspace = "C:/data".

share|improve this answer
Should have read @jburka's answer more carefully before posting! – djq May 5 '11 at 23:39

As someone else already pointed out, you can use the Batch option by right-clicking the tool in Toolbox. Otherwise, it's hard to know how best to batch it without knowing more about the feature classes and their locations (are they all in the same workspace? are they the only feature classes in that workspace?) and the type of buffers you want to create (e.g. will they all have the same distance)

These things all go into, for instance, whether you're better off just typing in the name of a few feature classes into a list or if you should be using something like arcpy.ListFeatureClasses to generate a list of feature classes to process.

Something as simple as:

import arcpy

arcpy.env.workspace = r'path\to\workspace'
featureClasses = ['fc1', 'fc2', 'fc3']
for featureClass in featureClasses:
  arcpy.Buffer_analysis(featureClass, "C:/output/" + featureClass + "Buffered" "100 Feet", "FULL", "ROUND", "LIST", "Distance")

would likely take care of it...

share|improve this answer

To batch buffer in ArcMap 10 you can use the built in tools. Just browse to Buffer in ArcToolbox (Analysis Tools < Proximity < Buffer), right-click the buffer tool and select batch.

share|improve this answer

Sorry, I couldn't edit my comment properly; this is how I would go

arcpy.env.workspace = r'path\to\workspace'   
fcs = arcpy.ListFeatureClasses()  

    for fc in fcs:  
        arcpy.Buffer_analysis(fc, outBufferFeatureClass, "X meters")  
    print "Error buffering FeatureClasses."`   

I hope that helps. You will have to thread if you want to do it all at the same time.

share|improve this answer
can you plaese Edit or comment back with arcpy.GetParameterAsText(0) for Input folder | arcpy.GetParameterAsText(1) for Buffer(Double) |arcpy.GetParameterAsText(2) for outputfolder ` arcpy.Buffer_analysis(fc, outputfolder+ fc", buffer) – GIS Data Butcher May 17 '15 at 6:14

Here is the ESRI Buffer/ArcPy link. Here you will find some general code examples.

share|improve this answer
thanks but there is not example for buffering more than one feture class at once – wetland May 5 '11 at 18:54
@GISlove Why would you need to buffer more than one feature class at a time? Just curious. – Michael Todd May 5 '11 at 19:04
i want to learn for and while loop in python . this is the reason for batch buffering – wetland May 5 '11 at 20:44
@GISlove Ah, I thought you meant that you wanted to run all of the buffering jobs simultaneously. Batch buffering via python makes more sense. – Michael Todd May 5 '11 at 23:17
If you want to do them all at the same time, you'll have to put it into threads. – Hairy May 6 '11 at 10:40

The Buffer tool does not work on more than one feature class at a time. If you want to buffer all the features in multiple feature classes, you will have to either merge the feature classes into one combined feature class and buffer that, or buffer each of the individual feature classes in a loop.

share|improve this answer

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.