Class: BufferParameters

jsts.operation.buffer.BufferParameters

new BufferParameters()

Contains the parameters which describe how a buffer should be constructed.
Source:

Members

(static) CAP_FLAT :int

Specifies a flat line buffer end cap style.
Type:
  • int
Source:

(static) CAP_ROUND :int

Specifies a round line buffer end cap style.
Type:
  • int
Source:

(static) CAP_SQUARE :int

Specifies a square line buffer end cap style.
Type:
  • int
Source:

(static) DEFAULT_MITRE_LIMIT :double

The default mitre limit Allows fairly pointy mitres.
Type:
  • double
Source:

(static) DEFAULT_QUADRANT_SEGMENTS :int

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.
Type:
  • int
Source:

(static) JOIN_BEVEL :int

Specifies a bevel join style.
Type:
  • int
Source:

(static) JOIN_MITRE

Specifies a mitre join style.
Source:

(static) JOIN_ROUND :int

Specifies a round join style.
Type:
  • int
Source:

Methods

(static) bufferDistanceError(quadSegs)

Computes the maximum distance error due to a given level of approximation to a true arc.
Parameters:
Name Type Description
quadSegs the number of segments used to approximate a quarter-circle.
Source:
Returns:
the error of approximation.

getEndCapStyle()

Gets the end cap style.
Source:
Returns:
the end cap style.

getJoinStyle()

Gets the join style
Source:
Returns:
the join style code.

getMitreLimit()

Gets the mitre ratio limit.
Source:
Returns:
the limit value.

getQuadrantSegments()

Gets the number of quadrant segments which will be used
Source:
Returns:
the number of quadrant segments.

isSingleSided()

Tests whether the buffer is to be generated on a single side only.
Source:
Returns:
true if the generated buffer is to be single-sided.

setEndCapStyle(endCapStyle)

Specifies the end cap style of the generated buffer. The styles supported are #CAP_ROUND, #CAP_BUTT, and #CAP_SQUARE. The default is CAP_ROUND.
Parameters:
Name Type Description
endCapStyle int the end cap style to specify.
Source:

setJoinStyle(joinStyle)

Sets the join style for outside (reflex) corners between line segments. Allowable values are JOIN_ROUND (which is the default), JOIN_MITRE and {link JOIN_BEVEL}.
Parameters:
Name Type Description
joinStyle the code for the join style.
Source:

setMitreLimit(mitreLimit)

Sets the limit on the mitre ratio used for very sharp corners. 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.
Parameters:
Name Type Description
mitreLimit the mitre ratio limit.
Source:

setQuadrantSegments(quadrantSegments)

Sets the number of line segments used to approximate an angle fillet.
  • If quadSegs >= 1, joins are round, and quadSegs indicates the number of segments to use to approximate a quarter-circle.
  • If quadSegs = 0, joins are bevelled (flat)
  • If quadSegs < 0, joins are mitred, and the value of qs indicates the mitre ration limit as
    mitreLimit= |
    
    quadSegs
    
    |
    
For round joins, quadSegs determines the maximum error in the approximation to the true buffer curve. The default 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. The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).
Parameters:
Name Type Description
quadrantSegments the number of segments in a fillet for a quadrant.
Source:

setQuadrantSegments(quadrantSegments)

Sets the number of segments used to approximate a angle fillet
Parameters:
Name Type Description
quadrantSegments int the number of segments in a fillet for a quadrant.
Source:

setSingleSided(isSingleSided)

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 CAP_FLAT.

Parameters:
Name Type Description
isSingleSided true if a single-sided buffer should be constructed.
Source: