2

I am using ArcGIS Desktop 10.4.

I would like to create multiple ring buffers surrounding my polygon localities. My buffers should not overlap and I need to know, which location each of my buffers surrounds.

I've thought to simply use arcpy.MultipleRingBuffer_analysis. However, if I use Dissolve_Option = "NONE", I am able to define which locations my buffers surround, as the locations ID is stored in newly created "ORIG_FID" field. However, my buffers overlap.

If I use Dissolve_Option = "ALL", my buffers do not overlap. But, I have no information about which location does my buffer surround.

How do I accomplish having multiple distances non-overlapping buffers but be able to know the location they belong to?

My code to create multiple ring buffers:

# Import modules
import arcpy, os

# Set environmental settings
inWD = "C:/Users/Localities"
arcpy.env.workspace = os.path.join(inWD, "analyzed.gdb")
outPath = os.path.join(inWD, "output.gdb")

# Allow files to overwrite
arcpy.env.overwriteOutput = True

# Define input variables
inFC = "NPR"

try:

    # Define Multiple ring buffer variables
    distances = [100, 500, 1000, 2000]
    buffUnit = "Meters"
    Field_Name = "distance"
    Dissolve_Option = "ALL"
    Outside_Polygons_Only = "OUTSIDE_ONLY"


    # Process: Multiple ring buffer
    outBuff = os.path.join(outPath, "buff_complete")
    arcpy.MultipleRingBuffer_analysis(inFC, outBuff, distances, buffUnit,
                                      Field_Name, Dissolve_Option,
                                      Outside_Polygons_Only)
except:

    print(arcpy.GetMessages(0))

Simple illustration for distances [100,500,1000,2000] Meters: even if I click only on 100 m buffer (the closest to inFC), my buffers have to overlap, as in attribute table I've selected 3 different buffers.

enter image description here

9
  • What do a couple of your input features and output buffers look like? A picture should help.
    – PolyGeo
    Feb 20, 2018 at 12:27
  • 1
    Just leave the buffers undissolved and erase the overlaps.
    – BERA
    Feb 20, 2018 at 12:41
  • how can I erase the overlaps please? Please, be more specific. I have Advance licence
    – maycca
    Feb 20, 2018 at 12:43
  • 1
    Hi @BERA, why did your answer disappear? Your approach actually solved my problem! Can you put it back that I can accept it?
    – maycca
    Feb 22, 2018 at 7:53
  • 1
    It was untested so i removed it thinking someone else would post an answer. Nice, i have undeleted it.
    – BERA
    Feb 22, 2018 at 8:10

1 Answer 1

2

Dont dissolve the buffer, just erase the overlaps. Add this after buffer:

outerasedbuffer = 'outerasebuffer'

for d in distances:
    if d==100:
        sql = """{0}={1}""".format(arcpy.AddFieldDelimiters(datasource=outbuff, field='distance'),d)
        arcpy.MakeFeatureLayer_management(in_features=outbuff, out_layer='lyr_100', 
                                         where_clause=sql)
    if d==500:
        sql = """{0}={1}""".format(arcpy.AddFieldDelimiters(datasource=outbuff, field='distance'),d)
        arcpy.MakeFeatureLayer_management(in_features=outbuff, out_layer='lyr_500', 
                                          where_clause=sql)        
        arcpy.Erase_analysis(in_features='lyr_500', erase_features='lyr_100', 
                            out_feature_class=r'in_memory\buff500')
    if d==1000:
        sql = """{0}={1}""".format(arcpy.AddFieldDelimiters(datasource=outbuff, field='distance'),d)
        arcpy.MakeFeatureLayer_management(in_features=outbuff, out_layer='lyr_1000', 
                                          where_clause=sql)        
        arcpy.Erase_analysis(in_features='lyr_1000', erase_features='lyr_500', 
                             out_feature_class=r'in_memory\buff1000')
    if d==2000:
        sql = """{0}={1}""".format(arcpy.AddFieldDelimiters(datasource=outbuff, field='distance'),d)
        arcpy.MakeFeatureLayer_management(in_features=outbuff, out_layer='lyr_2000', 
                                          where_clause=sql)        
        arcpy.Erase_analysis(in_features='lyr_2000', erase_features='lyr_1000', 
                             out_feature_class=r'in_memory\buff2000')
arcpy.Merge_management(inputs=['lyr_100', r'in_memory\buff500',r'in_memory\buff1000',r'in_memory\buff2000'], output=outerasedbuffer)

Or dissolve the buffers and join the attributes back using Spatial Join.

1
  • how would you go about doing the erase if there were about 100+ buffers? Apr 26, 2018 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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