ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / GraphicBuffer Method / GraphicBuffer(Geometry,Double,LineJoinType,LineCapType,Double,Double,Int32) Method
The geometry to buffer
The buffer distance in the unit of the geometry's spatial reference
The line join type
The line cap type
The threshold determining when miter joins are replaced with the bevel joins. Use a value of 4 for a good default.
The max deviation of the result buffer from the true buffer in the units of the spatial reference. When maxDeviation is NaN or 0, it is replaced with 1e-5 * abs(distance). When maxDeviation is larger than 0.5 * abs(distance), it is replaced with that value. See the remarks section for more information.
The maximum number of vertices in round polygon produced from a buffered point. A value of 96 is the recommended default value. If the value is less than 12, it is replaced with that value. See the remarks section for more information.
Example

In This Topic
    GraphicBuffer(Geometry,Double,LineJoinType,LineCapType,Double,Double,Int32) Method
    In This Topic
    Creates a buffer polygon at the specified distance around the input geometry using graphical joins and caps.
    Syntax

    Parameters

    geometry
    The geometry to buffer
    distance
    The buffer distance in the unit of the geometry's spatial reference
    joinType
    The line join type
    capType
    The line cap type
    miterLimit
    The threshold determining when miter joins are replaced with the bevel joins. Use a value of 4 for a good default.
    maxDeviation
    The max deviation of the result buffer from the true buffer in the units of the spatial reference. When maxDeviation is NaN or 0, it is replaced with 1e-5 * abs(distance). When maxDeviation is larger than 0.5 * abs(distance), it is replaced with that value. See the remarks section for more information.
    maxVerticesInFullCircle
    The maximum number of vertices in round polygon produced from a buffered point. A value of 96 is the recommended default value. If the value is less than 12, it is replaced with that value. See the remarks section for more information.

    Return Value

    Polygon representing the graphic buffer. If the input multipoint is empty, then an empty polygon is returned.
    Exceptions
    ExceptionDescription
    Geometry is null.
    The method is not implemented for GeometryBag or Multipatch.
    The buffer distance must be a valid floating point number.
    Remarks
    The maxDeviation and maxVerticesInFullCircle control the quality of round joins in the buffer. That is, the precision of the buffer is maxDeviation unless the number of required vertices is too large. The maxVerticesInFullCircle controls how many vertices can be in each round join in the buffer. It is approximately equal to the number of vertices in the polygon around a buffered point. It has a priority over maxDeviation. The max deviation is the distance from the result polygon to a true buffer. The real deviation is calculated as the max(maxDeviation, abs(distance) (1 - cos(PI / maxVerticesInFullCircle))).

    Note that maxDeviation can be exceeded because geometry is generalized with 0.25 times the real deviation, also input segments closer than 0.25 real deviation are snapped to a point.

    Note, this operator is equivalent to GeometryEngine.Buffer when the joins and caps are round.

    See stroke-miterlimit, stroke-linejoin, stroke-linecap parameters in the SVG specification for more info on the graphical parameters.

    Example
    GraphicBuffer
    // mitered join and butt caps
    SpatialReference sr = SpatialReferenceBuilder.CreateSpatialReference(102010);
    List<Coordinate2D> coords = new List<Coordinate2D>()
    {
        new Coordinate2D(1400,6200),
        new Coordinate2D(1600,6300),
        new Coordinate2D(1800,6200)
    };
    
    Polyline polyline = PolylineBuilderEx.CreatePolyline(coords, sr);
    
    Polygon polygon = GeometryEngine.Instance.GraphicBuffer(polyline, 50, LineJoinType.Miter, LineCapType.Butt, 10, 0, -1) as Polygon;
    
    // bevelled join and round caps
    Envelope envelope = EnvelopeBuilderEx.CreateEnvelope(0, 0, 10000, 10000, SpatialReferences.WebMercator);
    
    Polygon outPolygon = GeometryEngine.Instance.GraphicBuffer(envelope, 1000, LineJoinType.Bevel, LineCapType.Round, 4, 0, 96) as Polygon;
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also