Select to view content in your preferred language

Clip overlapping polygons individually to sometimes create multiple copies of one feature

1682
4
Jump to solution
09-06-2022 01:19 PM
LauraCulp
Emerging Contributor

I have been spinning my wheels on this for a while. It seems easy but I can't figure it out!

I have individual points on a map each with a 1000 ft buffer around them. Some of these buffers overlap with one another. I want to clip a zoning shapefile so I can get an idea as to how much of the land use in each of these buffers is zoned for residential compared to other uses. The issue is, because the features overlap, clipping tells me the overall breakdown of zoning, but not one associated with individual points. Each one is being treated as its own site, so a parcel of zoning may be associated with more than one buffer and may be clipped to different sizes to meet each buffer's boundaries.

Basically, I need to know if there is a way to have ArcGIS Pro iteratively run the clip process for each buffer against the original zoning file so some parcels can be clipped to multiple buffers. I am fine if this creates a new layer for each buffer.

 

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

It sounds like you only used the buffers as input fot the tool.

If you use the buffers and the parcels as input, the tool will return a feature class that has each intersection between buffers and parcels.

If Buffer_1 intersects the whole Parcel_1 and Buffer_2 intersects only a corner of Parcel_1, there will be two entries in the result feature class:

  1. whole geometry of Parcel_1 and the attributes of Parcel_1 & Buffer_1
  2. only the corner of Parcel_1 with the attributes of Parcel_1 & Buffer_2

You can then use the buffer attributes (eg ObjectID or another primary key) to filter out the intersections belonging to a certain buffer.

With a Python script, it would look like this:

parcel_layer = "Parcels"
buffer_layer = "Buffers"
output_class = "IntersectParcelsBuffers"

# intersect
result = arcpy.analysis.Intersect([parcel_layer, buffer_layer], output_class)

# create a layer of this feature class for each buffer
buffer_id_field = "FID_Buffers"  # ID field in the result table

buffer_ids = {row[0] for row in arcpy.da.SearchCursor(result, [buffer_id_field])}
for buffer_id in sorted(buffer_ids):
    arcpy.management.MakeFeatureLayer(result, f"Buffer {buffer_id}", f"{buffer_id_field} = {buffer_id}")

 

 

If you really want to use Clip, you can select each buffer and run it separately. This will take much longer and save a result feature class for each buffer (as opposed to the one result table for Intersect).

parcel_layer = "Parcels"
buffer_layer = "Buffer"
output_gdb = "" # default gdb, change if you want
buffer_id_field = "OBJECTID"

buffer_ids = {row[0] for row in arcpy.da.SearchCursor(buffer_layer, [buffer_id_field])}

import os
for buffer_id in buffer_ids:
    arcpy.management.SelectLayerByAttribute(buffer_layer, "NEW_SELECTION", f"{buffer_id_field} = {buffer_id}")
    arcpy.analysis.Clip(parcel_layer, buffer_layer, os.path.join(output_gdb, f"Clip_Buffer_{buffer_id}"))

 


Have a great day!
Johannes

View solution in original post

4 Replies
JohannesLindner
MVP Frequent Contributor

Intersect should do what you want.


Have a great day!
Johannes
0 Kudos
LauraCulp
Emerging Contributor

I tried intersect first and I'm not sure its the solution to my issue. Intersect will give me where the various buffers overlap. What I need is to clip the zoning layer multiple times for each overlapping polygon. One parcel may have five overlapping buffers that all overlap it in different amounts. I need to run a geoprocess that will create a separate clip for each buffer despite some parcels being counted multiple times.

I think I am doing a poor job of explaining my issue. I'm sorry! Thanks for your help!

0 Kudos
JohannesLindner
MVP Frequent Contributor

It sounds like you only used the buffers as input fot the tool.

If you use the buffers and the parcels as input, the tool will return a feature class that has each intersection between buffers and parcels.

If Buffer_1 intersects the whole Parcel_1 and Buffer_2 intersects only a corner of Parcel_1, there will be two entries in the result feature class:

  1. whole geometry of Parcel_1 and the attributes of Parcel_1 & Buffer_1
  2. only the corner of Parcel_1 with the attributes of Parcel_1 & Buffer_2

You can then use the buffer attributes (eg ObjectID or another primary key) to filter out the intersections belonging to a certain buffer.

With a Python script, it would look like this:

parcel_layer = "Parcels"
buffer_layer = "Buffers"
output_class = "IntersectParcelsBuffers"

# intersect
result = arcpy.analysis.Intersect([parcel_layer, buffer_layer], output_class)

# create a layer of this feature class for each buffer
buffer_id_field = "FID_Buffers"  # ID field in the result table

buffer_ids = {row[0] for row in arcpy.da.SearchCursor(result, [buffer_id_field])}
for buffer_id in sorted(buffer_ids):
    arcpy.management.MakeFeatureLayer(result, f"Buffer {buffer_id}", f"{buffer_id_field} = {buffer_id}")

 

 

If you really want to use Clip, you can select each buffer and run it separately. This will take much longer and save a result feature class for each buffer (as opposed to the one result table for Intersect).

parcel_layer = "Parcels"
buffer_layer = "Buffer"
output_gdb = "" # default gdb, change if you want
buffer_id_field = "OBJECTID"

buffer_ids = {row[0] for row in arcpy.da.SearchCursor(buffer_layer, [buffer_id_field])}

import os
for buffer_id in buffer_ids:
    arcpy.management.SelectLayerByAttribute(buffer_layer, "NEW_SELECTION", f"{buffer_id_field} = {buffer_id}")
    arcpy.analysis.Clip(parcel_layer, buffer_layer, os.path.join(output_gdb, f"Clip_Buffer_{buffer_id}"))

 


Have a great day!
Johannes
LauraCulp
Emerging Contributor

YES THANK YOU I knew I was missing something.

Thank you so much!

0 Kudos