3

Using Arcmap 10.5.1, I need to buffer a line feature class with varying buffer widths, according to the values in one of the feature class attributes. The buffer ends must be flat.

When the line (or portions of it) are straight, the buffering works well, as in this hand-drawn representation:

enter image description here

However, when the line bends, the resulting buffers have an overlap on the inside of the curve, and a gap on the outside:

enter image description here

The overlaps and gaps are a problem. The output feature class must have the overlaps reduced to a single polygon and the the gaps filled in.

I can flatten the overlaps to single polygons using a combination of unioning and dissolving. However, I do not know how to fill in the gaps with new polygons. I'm envisioning one possible solution with the following graphic; the grey areas represent the "fill-in" polygons:

enter image description here

I have thousands of such lines, so hand editing is out. Any thoughts on how to create polygons in the gaps?

  • I suggest the ArcGIS Aggregate Polygons tool, an Advanced license is required. Otherwise, research Concave Hull or Alpha Shape. – klewis Sep 29 '17 at 19:37
  • Could you not just set the “line end type” to “round” and “dissolve type” parameter to “all” in the dissolve tool? The gaps won’t be filled as you’ve illustrated, but they will be filled. – Jae Sep 30 '17 at 10:32
  • Constructing a line buffer using trigonometry isn't all that difficult, especially in a projected coordinate system. I've done this in Java with a List on the front side and a Stack on the back, then popping off the stack vertices when I get to the end;, Python would be just as capable, you'd just need to handle a few special cases. – Vince Sep 30 '17 at 11:12
  • I initially considered your approach. However, by dissolving on "all", the uniqueness of each segment (the varying colors in my OP) is lost. – Stu Smith Oct 4 '17 at 2:56
1

Let me know if raster solution is an option,and I'll post a workflow based on distance and allocation.

WORKFLOW:

-------------------

arcpy.Dissolve_management("SEGMENTS","../SINGLE_LINE.shp")
arcpy.Buffer_analysis("SINGLE_LINE", "../CUTTER.shp", "50 Meters", method="PLANAR")
arcpy.gp.EucAllocation_sa("SEGMENTS", "../ALLOCATION", "", "", "0.5", "FID")
arcpy.RasterToPolygon_conversion("ALLOCATION","../voronoi.shp", "SIMPLIFY", "VALUE")
arcpy.AddField_management("voronoi", "WIDTH")

Transfer buffers width into voronois polygons from segments table. I used segments FID to compute allocation, so I used voronois GRIDCODE and segments FID to join tables and populate newly created field.

*# this is how it looks with my adavanced field calculator info only (!)
arcpy.FieldsxyzAdvancedFieldCalculator(Transfer_from__SOURCE_="SEGMENTS", Using_join_field="FID", Source_field="WIDTH", DESTINATION_layer="voronoi", Join_field_in_it="GRIDCODE", Destination_field="WIDTH")*

arcpy.PolygonToRaster_conversion("voronoi", "WIDTH", "../LIMITS")
arcpy.gp.EucDistance_sa("SEGMENTS", "../distance")
arcpy.gp.RasterCalculator_sa("""Con("LIMITS" >= "distance","ALLOCATION")""", "../to_B_cut")
arcpy.RasterToPolygon_conversion("to_B_cut","../rounded.shp")
arcpy.Clip_analysis("rounded", "CUTTER", "../RESULTS.shp")

-----------------

RESULTS:

enter image description here

perhaps not ideal, but I applied 60 and 90 degreess turns and very steep changes in buffer widths. Smoother turns and changes in buffer widths will produce near perfect looks. Set environment extent to Clipper after computing it, see line 2.

  • Yes, I'm interested in your raster solution. Please post. – Stu Smith Oct 4 '17 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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