Search Results for

    Show / Hide Table of Contents

    Class BufferParameters

    A value class containing the parameters which specify how a buffer should be constructed.

    The parameters allow control over:
    • Quadrant segments (accuracy of approximation for circular arcs)
    • End Cap style
    • Join style
    • Mitre limit
    • whether the buffer is single-sided
    Inheritance
    object
    BufferParameters
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Operation.Buffer
    Assembly: NetTopologySuite.dll
    Syntax
    public class BufferParameters

    Constructors

    | Edit this page View Source

    BufferParameters()

    Creates a default set of parameters

    Declaration
    public BufferParameters()
    | Edit this page View Source

    BufferParameters(int)

    Creates a set of parameters with the given quadrantSegments value.

    Declaration
    public BufferParameters(int quadrantSegments)
    Parameters
    Type Name Description
    int quadrantSegments

    The number of quadrant segments to use

    | Edit this page View Source

    BufferParameters(int, EndCapStyle)

    Creates a set of parameters with the given quadrantSegments and endCapStyle values.

    Declaration
    public BufferParameters(int quadrantSegments, EndCapStyle endCapStyle)
    Parameters
    Type Name Description
    int quadrantSegments

    the number of quadrant segments to use

    EndCapStyle endCapStyle

    the end cap style to use

    | Edit this page View Source

    BufferParameters(int, EndCapStyle, JoinStyle, double)

    Creates a set of parameters with the given parameter values.

    Declaration
    public BufferParameters(int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit)
    Parameters
    Type Name Description
    int quadrantSegments

    the number of quadrant segments to use

    EndCapStyle endCapStyle

    the end cap style to use

    JoinStyle joinStyle

    the join style to use

    double mitreLimit

    the mitre limit to use

    Fields

    | Edit this page View Source

    DefaultJoinStyle

    The default number of facets into which to divide a fillet of 90 degrees.
    A value of 8 gives less than 2% max error in the buffer distance.

    For a max error of < 1%, use QS = 12.

    For a max error of < 0.1%, use QS = 18.
    Declaration
    public const JoinStyle DefaultJoinStyle = Round
    Field Value
    Type Description
    JoinStyle
    | Edit this page View Source

    DefaultMitreLimit

    The default mitre limit Allows fairly pointy mitres.

    Declaration
    public const double DefaultMitreLimit = 5
    Field Value
    Type Description
    double
    | Edit this page View Source

    DefaultQuadrantSegments

    The default number of facets into which to divide a fillet of 90 degrees.
    A value of 8 gives less than 2% max error in the buffer distance.

    For a max error of < 1%, use QS = 12.

    For a max error of < 0.1%, use QS = 18.
    Declaration
    public const int DefaultQuadrantSegments = 8
    Field Value
    Type Description
    int
    | Edit this page View Source

    DefaultSimplifyFactor

    The default simplify factor. Provides an accuracy of about 1%, which matches the accuracy of the DefaultQuadrantSegments parameter.

    Declaration
    public const double DefaultSimplifyFactor = 0.01
    Field Value
    Type Description
    double

    Properties

    | Edit this page View Source

    EndCapStyle

    Gets or sets the end cap style of the generated buffer.

    Declaration
    public EndCapStyle EndCapStyle { get; set; }
    Property Value
    Type Description
    EndCapStyle
    Remarks

    The styles supported are Round, Flat, and Square.

    The default is Round.

    | Edit this page View Source

    IsSingleSided

    Gets or sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line.

    The side used is determined by the sign of the buffer distance:

    • a positive distance indicates the left-hand side
    • a negative distance indicates the right-hand side
    The single-sided buffer of point geometries is the same as the regular buffer.

    The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of Flat.

    Declaration
    public bool IsSingleSided { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    JoinStyle

    Gets/Sets the join style for outside (reflex) corners between line segments.

    Declaration
    public JoinStyle JoinStyle { get; set; }
    Property Value
    Type Description
    JoinStyle
    Remarks

    The styles supported are Round, Mitre and Bevel

    The default is Round
    | Edit this page View Source

    MitreLimit

    Sets the limit on the mitre ratio used for very sharp corners.

    Declaration
    public double MitreLimit { get; set; }
    Property Value
    Type Description
    double
    Remarks

    The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled.

    | Edit this page View Source

    QuadrantSegments

    Gets or sets the number of line segments in a quarter-circle used to approximate angle fillets in round endcaps and joins. The value should be at least 1.

    This determines the error in the approximation to the true buffer curve.
    The default value of 8 gives less than 2% error in the buffer distance.

    For an error of < 1%, use QS = 12.

    For an error of < 0.1%, use QS = 18.

    The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).
    Declaration
    public int QuadrantSegments { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    SimplifyFactor

    Factor used to determine the simplify distance tolerance for input simplification. Simplifying can increase the performance of computing buffers. Generally the simplify factor should be greater than 0. Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. Larger values sacrifice accuracy in return for performance.

    Declaration
    public double SimplifyFactor { get; set; }
    Property Value
    Type Description
    double

    Methods

    | Edit this page View Source

    BufferDistanceError(int)

    Computes the maximum distance error due to a given level of approximation to a true arc.

    Declaration
    public static double BufferDistanceError(int quadSegs)
    Parameters
    Type Name Description
    int quadSegs

    The number of segments used to approximate a quarter-circle

    Returns
    Type Description
    double

    The error of approximation

    | Edit this page View Source

    Copy()

    Creates a copy

    Declaration
    public BufferParameters Copy()
    Returns
    Type Description
    BufferParameters
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX