Class: BufferOp

jsts.operation.buffer.BufferOp

new BufferOp(g, bufParams)

Initializes a buffer computation for the given geometry with the given set of parameters.
Parameters:
Name Type Description
g Geometry the geometry to buffer.
bufParams BufferParameters the buffer parameters to use.
Source:

Members

(static) MAX_PRECISION_DIGITS :int

A number of digits of precision which leaves some computational "headroom" for floating point operations. This value should be less than the decimal precision of double-precision values (16).
Type:
  • int
Source:

argGeom :Geometry

Type:
  • Geometry
Source:

bufParams :BufferParameters

Type:
  • BufferParameters
Source:

distance :double

Type:
  • double
Source:

resultGeometry :Geometry

Type:
  • Geometry
Source:

Methods

(static) bufferOp(g, distance) → {Geometry}

Computes the buffer of a geometry for a given buffer distance.
Parameters:
Name Type Description
g Geometry the geometry to buffer.
distance double the buffer distance.
Source:
Returns:
the buffer of the input geometry.
Type
Geometry

(static) bufferOp2(g, distance, params) → {Geometry}

Computes the buffer for a geometry for a given buffer distance and accuracy of approximation.
Parameters:
Name Type Description
g Geometry the geometry to buffer.
distance double the buffer distance.
params BufferParameters the buffer parameters to use.
Source:
Returns:
the buffer of the input geometry.
Type
Geometry

(static) bufferOp3(g, distance, quadrantSegments) → {Geometry}

Computes the buffer for a geometry for a given buffer distance and accuracy of approximation.
Parameters:
Name Type Description
g Geometry the geometry to buffer.
distance double the buffer distance.
quadrantSegments int the number of segments used to approximate a quarter circle.
Source:
Returns:
the buffer of the input geometry.
Type
Geometry

(static) bufferOp4(g, distance, quadrantSegments, endCapStyle) → {Geometry}

Computes the buffer for a geometry for a given buffer distance and accuracy of approximation.
Parameters:
Name Type Description
g Geometry the geometry to buffer.
distance double the buffer distance.
quadrantSegments int the number of segments used to approximate a quarter circle.
endCapStyle int the end cap style to use.
Source:
Returns:
the buffer of the input geometry.
Type
Geometry

(static) precisionScaleFactor(g, distance, maxPrecisionDigits) → {double}

Compute a scale factor to limit the precision of a given combination of Geometry and buffer distance. The scale factor is determined by a combination of the number of digits of precision in the (geometry + buffer distance), limited by the supplied maxPrecisionDigits value.
Parameters:
Name Type Description
g Geometry the Geometry being buffered.
distance double the buffer distance.
maxPrecisionDigits int the max # of digits that should be allowed by the precision determined by the computed scale factor.
Source:
Returns:
a scale factor for the buffer computation.
Type
double

bufferFixedPrecision(fixedPM)

Parameters:
Name Type Description
fixedPM PrecisionModel
Source:

bufferReducedPrecision2(precisionDigits)

Parameters:
Name Type Description
precisionDigits int
Source:

getResultGeometry(dist) → {Geometry}

Returns the buffer computed for a geometry for a given buffer distance.
Parameters:
Name Type Description
dist double the buffer distance.
Source:
Returns:
the buffer of the input geometry.
Type
Geometry

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:

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: