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 want to write a loop that will cause the output to be multiple buffer shapefiles.

For example, I want a circle buffer of 50ft, 100ft, 150ft, etc.

Can anyone help?

I'm new to this and am trying to figure it out myself.

share|improve this question
I know there is a tool that can do this (Multiple Ring Buffer) but I want to know how to write a loop. – George Diamond Sep 21 '12 at 1:20

The ArcGIS Resource Center has the following sample script demonstrating how to do multiple ring buffers using Python

# Name:
# Description: Create multiple buffers for the input features
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data/airport.gdb"

# Set local variables
inFeatures = "schools"
outFeatureClass = "c:/output/output.gdb/multibuffer1"
distances = [10,20,30]
bufferUnit = "meters"

# Execute MultipleRingBuffer
arcpy.MultipleRingBuffer_analysis(inFeatures, outFeatureClass, distances, bufferUnit, "", "ALL")

Here's how to do it if you insist on having a for loop

import arcpy

arcpy.env.workspace = "C:/data" 

distances =[50, 100, 150]
for distance in distances:
    outfile = "C:/output/majorrdsBuffered%s" % distance  
    arcpy.Buffer_analysis("roads", outfile, distance, "FULL", "ROUND", "LIST", "Distance")
share|improve this answer
Would that for loop code not overwrite it's own outputs? It could be altered to say out_file = "C:/output/majorrdsBuffered" + str(distance) to put the buffersize in the filename. – sgrieve Sep 24 '12 at 8:09
Thanks for noticing. Will update the answer. – R.K. Sep 24 '12 at 9:32
arcpy.Buffer_analysis(clipoutfile, buffered + "_" + str(x) + ".shp", str(x)+" "+buff_unit) this is what I ended up doing as a call. – George Diamond Sep 26 '12 at 0:09
Did it work? Good to know. The file names are your call in the end. – R.K. Sep 26 '12 at 5:18
@user37199 an answer to that is too long for comments. Why don't you post a separate question? :) – nmpeterson Sep 19 '14 at 14:10

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.