GEOS 3.11.1
Public Member Functions | Static Public Member Functions | List of all members
geos::operation::buffer::OffsetCurve Class Reference

#include <OffsetCurve.h>

Public Member Functions

 OffsetCurve (const Geometry &geom, double dist)
 
 OffsetCurve (const Geometry &geom, double dist, BufferParameters &bp)
 
std::unique_ptr< GeometrygetCurve ()
 

Static Public Member Functions

static std::unique_ptr< GeometrygetCurve (const Geometry &geom, double dist, int quadSegs, BufferParameters::JoinStyle joinStyle, double mitreLimit)
 
static std::unique_ptr< GeometrygetCurve (const Geometry &geom, double dist)
 
static void rawOffset (const LineString &geom, double dist, BufferParameters &bufParams, std::vector< CoordinateSequence * > &lineList)
 
static void rawOffset (const LineString &geom, double dist, std::vector< CoordinateSequence * > &lineList)
 

Detailed Description

Computes an offset curve from a geometry. The offset curve is a linear geometry which is offset a specified distance from the input. If the offset distance is positive the curve lies on the left side of the input; if it is negative the curve is on the right side.

The offset curve of a line is a LineString which The offset curve of a Point is an empty LineString. The offset curve of a Polygon is the boundary of the polygon buffer (which may be a MultiLineString. For a collection the output is a MultiLineString of the element offset curves.

The offset curve is computed as a single contiguous section of the geometry buffer boundary. In some geometric situations this definition is ill-defined. This algorithm provides a "best-effort" interpretation. In particular:

Offset curves support setting the number of quadrant segments, the join style, and the mitre limit (if applicable) via the BufferParameters.

Author
Martin Davis

Constructor & Destructor Documentation

◆ OffsetCurve() [1/2]

geos::operation::buffer::OffsetCurve::OffsetCurve ( const Geometry geom,
double  dist 
)
inline

Creates a new instance for computing an offset curve for a geometryat a given distance. with default quadrant segments BufferParameters::DEFAULT_QUADRANT_SEGMENTS and join style BufferParameters::JOIN_STYLE.

Parameters
geomthe geometry to offset
distthe offset distance (positive = left, negative = right)
See also
BufferParameters

◆ OffsetCurve() [2/2]

geos::operation::buffer::OffsetCurve::OffsetCurve ( const Geometry geom,
double  dist,
BufferParameters bp 
)
inline

Creates a new instance for computing an offset curve for a geometry at a given distance. allowing the quadrant segments and join style and mitre limit to be set via BufferParameters.

Parameters
geom
dist
bp

Member Function Documentation

◆ getCurve()

static std::unique_ptr< Geometry > geos::operation::buffer::OffsetCurve::getCurve ( const Geometry geom,
double  dist,
int  quadSegs,
BufferParameters::JoinStyle  joinStyle,
double  mitreLimit 
)
static

Computes the offset curve of a geometry at a given distance, and for a specified quadrant segments, join style and mitre limit.

Parameters
geoma geometry
distthe offset distance (positive = left, negative = right)
quadSegsthe quadrant segments (-1 for default)
joinStylethe join style (-1 for default)
mitreLimitthe mitre limit (-1 for default)
Returns
the offset curve

◆ rawOffset()

static void geos::operation::buffer::OffsetCurve::rawOffset ( const LineString geom,
double  dist,
BufferParameters bufParams,
std::vector< CoordinateSequence * > &  lineList 
)
static

Gets the raw offset line. The quadrant segments and join style and mitre limit to be set via BufferParameters.

The raw offset line may contain loops and other artifacts which are not present in the true offset curve. The raw offset line is matched to the buffer ring (which is clean) to extract the offset curve.

Parameters
geomthe linestring to offset
distthe offset distance
bufParamsthe buffer parameters to use
lineListthe vector to populate with the return value

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