Buffer within a line or polygon

4664
7
Jump to solution
04-13-2015 02:00 PM
CGrantham
New Contributor II

I have read that to create a buffer within a line or polygon, use a negative number for the unit (e.g. -100 meters).  However, in ArcMap 10.2 this is not allowed or in my experience it creates an error.  I have a an area either polygon or polyline (I have created both to attempt the buffer) that I would like to have a 100 meter buffer within the boundary ONLY.  When I create the buffer from the line example, it is 100 meters on each side (inside the line and outside the line; I only want inside) and when I create the buffer from the polygon example it buffers everything within the feature. Suggestions?  I apologize if this has been mentioned before, I did not find it while searching for an answer.

0 Kudos
1 Solution

Accepted Solutions
ChrisDonohue__GISP
MVP Frequent Contributor

Another simpler suggestion after reading through your request again (and the morning caffeine hit is finally kicking in)  .

1. Take the existing line you have and run the Buffer with the default settings (don't worry about line side).

2.  Clip the new buffer using your polygon.  The result should be the buffer within your polygon.  Unless there is some other complexity I missed....

This can be run with any license level.

Chris Donohue, GISP

View solution in original post

7 Replies
DanPatterson_Retired
MVP Esteemed Contributor

A line doesn't have an interior, do you by chance mean you converted a polygon to a polyline?  If you buffered interior to a polygon, do you have the appropriate distance specified.  Buffer warning from the help files

If the negative buffer distance is large enough to collapse the polygon to nothing, a null geometry will be generated. A warning message will be given, and any null geometry features will not be written to the output feature class.

And do you have the correct license level to perform that buffer?

ArcGIS for Desktop Basic: Limited

ArcGIS for Desktop Standard: Limited

ArcGIS for Desktop Advanced: Yes

0 Kudos
DarrenWiens2
MVP Honored Contributor

If I understand correctly, you want to create an inside ring buffer, without going through the trouble of making your negative buffer and erasing it from the original polygons. You can bypass that step using Python. The following makes inside buffers 10m (due to the input coordinate system) in from polygon boundaries in the feature class "Parcel Selection":

>>> fc = "Parcel selection"
... buffs = []
... with arcpy.da.SearchCursor(fc,"SHAPE@") as cursor:
...    for row in cursor:
...        ringBuff = row[0].difference(row[0].buffer(-10))
...        buffs.append(ringBuff)
... arcpy.CopyFeatures_management(buffs,r'in_memory\ringBuffs')

1.png2.png

CGrantham
New Contributor II

The attached pdf is a portion of the polygon I would like to place the inside buffer.  The yellow crosshatched area is the fill of the buffer, all I want to be able to do is to have the buffer where the white non-filled area is represented (100 M buffer) and not have the yellow cross-hatched area.  I placed a scale bar for reference.

I am not interested in the outside of the line, just interior.

I am unfamiliar with Python and ring buffers.

I am not sure on the licensing aspect of the software as it is institutionally owned.

0 Kudos
ChrisDonohue__GISP
MVP Frequent Contributor

EDIT:  Check the suggestion I have after this one, as it is easier.   This one could still work too, but requires a higher license level.

If you have an Advanced license (to check in ArcMap, Help, About), one workflow that could work would be this:

Buffer the line version of your polygon, being sure to set the "Line Side" parameter as Left or Right (may have to experiment to see which one works).  Also, "Line End Type" should probably be "Flat" just to be safe (but probably doesn't matter).

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

Note - this assumes the polygon was drawn with same directionality - i.e. all the linework was drawn clockwise or counter-clockwise.  If that is not the case, you will have to change the line directionality or redraw the polygon as a line all in the same direction.

ArcGIS Desktop

Chris Donohue, GISP

0 Kudos
ChrisDonohue__GISP
MVP Frequent Contributor

Another simpler suggestion after reading through your request again (and the morning caffeine hit is finally kicking in)  .

1. Take the existing line you have and run the Buffer with the default settings (don't worry about line side).

2.  Clip the new buffer using your polygon.  The result should be the buffer within your polygon.  Unless there is some other complexity I missed....

This can be run with any license level.

Chris Donohue, GISP

DarrenWiens2
MVP Honored Contributor

In ArcMap, if you have a polygon layer named, "Parcels" which has coordinate system using meters as the unit, the following code will produce the inside 100m buffer and place in an in-memory layer called, "ringBuffs" (paste into the Python window). You could change that path to disk if you choose (e.g. r'C:\spatialData\ringBuffs.shp'):

>>> fc = "Parcels"
... distance = -100
... buffs = []
... with arcpy.da.SearchCursor(fc,"SHAPE@") as cursor:
...    for row in cursor:
...        ringBuff = row[0].difference(row[0].buffer(distance))
...        buffs.append(ringBuff)
... arcpy.CopyFeatures_management(buffs,r'in_memory\ringBuffs')

Chris' suggestion for buffer/clip works just as well, but you need to run two things, rather than this one thing.

0 Kudos
CGrantham
New Contributor II

Thank you to all who responded, I am confident all answers were correct, however; the clip function from Chris Donohue was the easiest for me to complete and resolve my issues.

0 Kudos