geos::operation::buffer::OffsetCurveBuilder Class Reference

Computes the raw offset curve for a single Geometry component (ring, line or point). More...

`#include <OffsetCurveBuilder.h>`

## Public Member Functions

| OffsetCurveBuilder (const PrecisionModel *newPrecisionModel, const BufferParameters &nBufParams)
const BufferParameters & | getBufferParameters () const
| Gets the buffer parameters being used to generate the curve.
bool | isLineOffsetEmpty (double distance)
void | getLineCurve (const CoordinateSequence *inputPts, double distance, std::vector< CoordinateSequence * > &lineList)
| This method handles single points as well as lines.
std::unique_ptr< CoordinateSequence > | getLineCurve (const CoordinateSequence *inputPts, double pDistance)
void | getSingleSidedLineCurve (const CoordinateSequence *inputPts, double distance, std::vector< CoordinateSequence * > &lineList, bool leftSide, bool rightSide)
| This method handles single points as well as lines.
void | getRingCurve (const CoordinateSequence *inputPts, int side, double distance, std::vector< CoordinateSequence * > &lineList)
| This method handles the degenerate cases of single points and lines, as well as rings.
std::unique_ptr< CoordinateSequence > | getRingCurve (const CoordinateSequence *inputPts, int side, double pDistance)
void | getOffsetCurve (const CoordinateSequence *inputPts, double p_distance, std::vector< CoordinateSequence * > &lineList)
std::unique_ptr< CoordinateSequence > | getOffsetCurve (const CoordinateSequence *inputPts, double pDistance)

## Detailed Description

Computes the raw offset curve for a single Geometry component (ring, line or point).

A raw offset curve line is not noded - it may contain self-intersections (and usually will). The final buffer polygon is computed by forming a topological graph of all the noded raw curves and tracing outside contours. The points in the raw curve are rounded to a given PrecisionModel.

Note: this may not produce correct results if the input contains repeated or invalid points. Repeated points should be removed before calling. See removeRepeatedAndInvalidPoints.

## Member Function Documentation

## getBufferParameters()

const BufferParameters & geos::operation::buffer::OffsetCurveBuilder::getBufferParameters | ( |  | ) | const

inline

Gets the buffer parameters being used to generate the curve.

Returns
  the buffer parameters being used

## getLineCurve() [1/2]

void geos::operation::buffer::OffsetCurveBuilder::getLineCurve | ( | const CoordinateSequence * | inputPts,
|  | double | distance,
|  | std::vector< CoordinateSequence * > & | lineList )

This method handles single points as well as lines.

Lines are assumed to not be closed (the function will not fail for closed lines, but will generate superfluous line caps).

Parameters

  inputPts | input points
  distance | offset distance
  lineList | the std::vector to which the newly created CoordinateSequences will be pushed_back. Caller is responsible to delete these new elements.

## getLineCurve() [2/2]

std::unique_ptr< CoordinateSequence > geos::operation::buffer::OffsetCurveBuilder::getLineCurve | ( | const CoordinateSequence * | inputPts,
|  | double | pDistance )

This method handles single points as well as LineStrings. LineStrings are assumed not to be closed (the function will not fail for closed lines, but will generate superfluous line caps).

Parameters

  inputPts | the vertices of the line to offset
  pDistance | the offset distance

Returns
  a Coordinate array representing the curve or null if the curve is empty

## getRingCurve() [1/2]

void geos::operation::buffer::OffsetCurveBuilder::getRingCurve | ( | const CoordinateSequence * | inputPts,
|  | int | side,
|  | double | distance,
|  | std::vector< CoordinateSequence * > & | lineList )

This method handles the degenerate cases of single points and lines, as well as rings.

Parameters

  inputPts | input points
  side | a Position
  distance | offset distance
  lineList | the std::vector to which CoordinateSequences will be pushed_back

## getRingCurve() [2/2]

std::unique_ptr< CoordinateSequence > geos::operation::buffer::OffsetCurveBuilder::getRingCurve | ( | const CoordinateSequence * | inputPts,
|  | int | side,
|  | double | pDistance )

This method handles the degenerate cases of single points and lines, as well as valid rings.

Parameters

  inputPts | the coordinates of the ring (must not contain repeated points)
  side | side the side Position of the ring on which to construct the buffer line
  pDistance | the positive distance at which to create the offset

Returns
  a Coordinate array representing the curve, or null if the curve is empty

## getSingleSidedLineCurve()

void geos::operation::buffer::OffsetCurveBuilder::getSingleSidedLineCurve | ( | const CoordinateSequence * | inputPts,
|  | double | distance,
|  | std::vector< CoordinateSequence * > & | lineList,
|  | bool | leftSide,
|  | bool | rightSide )

This method handles single points as well as lines.

Lines are assumed to not be closed (the function will not fail for closed lines, but will generate superfluous line caps).

Parameters

  inputPts | input points
  distance | offset distance
  lineList | the std::vector to which newly created CoordinateSequences will be pushed_back. Caller will be responsible to delete them.
  leftSide | indicates that the left side buffer will be obtained/skipped
  rightSide | indicates that the right side buffer will be obtained/skipped

Note
  This is a GEOS extension.

## isLineOffsetEmpty()

bool geos::operation::buffer::OffsetCurveBuilder::isLineOffsetEmpty | ( | double | distance | ) |

Tests whether the offset curve for line or point geometries at the given offset distance is empty (does not exist). This is the case if:

- the distance is zero,
- the distance is negative, except for the case of singled-sided buffers

Parameters

  distance | the offset curve distance

Returns
  true if the offset curve is empty

The documentation for this class was generated from the following file:

- OffsetCurveBuilder.h