GEOS
3.9.1dev
|
Contains the parameters which describe how a buffer should be constructed. More...
#include <BufferParameters.h>
Public Types | |
enum | EndCapStyle { CAP_ROUND = 1, CAP_FLAT = 2, CAP_SQUARE = 3 } |
End cap styles. More... | |
enum | JoinStyle { JOIN_ROUND = 1, JOIN_MITRE = 2, JOIN_BEVEL = 3 } |
Join styles. More... | |
Public Member Functions | |
BufferParameters () | |
Creates a default set of parameters. More... | |
BufferParameters (int quadrantSegments) | |
BufferParameters (int quadrantSegments, EndCapStyle endCapStyle) | |
Creates a set of parameters with the given quadrantSegments and endCapStyle values. More... | |
BufferParameters (int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit) | |
Creates a set of parameters with the given parameter values. More... | |
int | getQuadrantSegments () const |
void | setQuadrantSegments (int quadSegs) |
Sets the number of line segments used to approximate an angle fillet. More... | |
EndCapStyle | getEndCapStyle () const |
void | setEndCapStyle (EndCapStyle style) |
JoinStyle | getJoinStyle () const |
void | setJoinStyle (JoinStyle style) |
Sets the join style for outside (reflex) corners between line segments. More... | |
double | getMitreLimit () const |
void | setMitreLimit (double limit) |
void | setSingleSided (bool p_isSingleSided) |
bool | isSingleSided () const |
Static Public Member Functions | |
static double | bufferDistanceError (int quadSegs) |
Computes the maximum distance error due to a given level of approximation to a true arc. More... | |
Static Public Attributes | |
static const int | DEFAULT_QUADRANT_SEGMENTS = 8 |
The default number of facets into which to divide a fillet of 90 degrees. More... | |
static const double | DEFAULT_MITRE_LIMIT |
Private Attributes | |
int | quadrantSegments |
Defaults to DEFAULT_QUADRANT_SEGMENTS;. More... | |
EndCapStyle | endCapStyle |
Defaults to CAP_ROUND;. More... | |
JoinStyle | joinStyle |
Defaults to JOIN_ROUND;. More... | |
double | mitreLimit |
Defaults to DEFAULT_MITRE_LIMIT;. More... | |
bool | _isSingleSided |
Contains the parameters which describe how a buffer should be constructed.
Definition at line 57 of file BufferParameters.h.
End cap styles.
Enumerator | |
---|---|
CAP_ROUND |
Specifies a round line buffer end cap style. |
CAP_FLAT |
Specifies a flat line buffer end cap style. |
CAP_SQUARE |
Specifies a square line buffer end cap style. |
Definition at line 62 of file BufferParameters.h.
Join styles.
Enumerator | |
---|---|
JOIN_ROUND |
Specifies a round join style. |
JOIN_MITRE |
Specifies a mitre join style. |
JOIN_BEVEL |
Specifies a bevel join style. |
Definition at line 75 of file BufferParameters.h.
geos::operation::buffer::BufferParameters::BufferParameters | ( | ) |
Creates a default set of parameters.
geos::operation::buffer::BufferParameters::BufferParameters | ( | int | quadrantSegments | ) |
Creates a set of parameters with the given quadrantSegments value.
quadrantSegments | the number of quadrant segments to use |
geos::operation::buffer::BufferParameters::BufferParameters | ( | int | quadrantSegments, |
EndCapStyle | endCapStyle | ||
) |
Creates a set of parameters with the given quadrantSegments and endCapStyle values.
quadrantSegments | the number of quadrant segments to use |
endCapStyle | the end cap style to use |
geos::operation::buffer::BufferParameters::BufferParameters | ( | int | quadrantSegments, |
EndCapStyle | endCapStyle, | ||
JoinStyle | joinStyle, | ||
double | mitreLimit | ||
) |
Creates a set of parameters with the given parameter values.
quadrantSegments | the number of quadrant segments to use |
endCapStyle | the end cap style to use |
joinStyle | the join style to use |
mitreLimit | the mitre limit to use |
|
static |
Computes the maximum distance error due to a given level of approximation to a true arc.
quadSegs | the number of segments used to approximate a quarter-circle |
|
inline |
|
inline |
|
inline |
Gets the mitre ratio limit.
Definition at line 237 of file BufferParameters.h.
|
inline |
Gets the number of quadrant segments which will be used
Definition at line 138 of file BufferParameters.h.
|
inline |
Tests whether the buffer is to be generated on a single side only.
Definition at line 290 of file BufferParameters.h.
|
inline |
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.
style | the end cap style to specify |
Definition at line 202 of file BufferParameters.h.
|
inline |
Sets the join style for outside (reflex) corners between line segments.
Allowable values are JOIN_ROUND (which is the default), JOIN_MITRE and JOIN_BEVEL.
style | the code for the join style |
Definition at line 227 of file BufferParameters.h.
|
inline |
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.
limit | the mitre ratio limit |
Definition at line 256 of file BufferParameters.h.
void geos::operation::buffer::BufferParameters::setQuadrantSegments | ( | int | quadSegs | ) |
Sets the number of line segments used to approximate an angle fillet.
quadSegs
>= 1, joins are round, and quadSegs
indicates the number of segments to use to approximate a quarter-circle.quadSegs
= 0, joins are bevelled (flat)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).
quadSegs | the number of segments in a fillet for a quadrant |
|
inline |
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:
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
.
p_isSingleSided | true if a single-sided buffer should be constructed |
Definition at line 279 of file BufferParameters.h.
|
private |
Definition at line 310 of file BufferParameters.h.
|
static |
The default mitre limit
Allows fairly pointy mitres.
Definition at line 101 of file BufferParameters.h.
|
static |
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.
Definition at line 95 of file BufferParameters.h.
|
private |
Defaults to CAP_ROUND;.
Definition at line 302 of file BufferParameters.h.
|
private |
Defaults to JOIN_ROUND;.
Definition at line 305 of file BufferParameters.h.
|
private |
Defaults to DEFAULT_MITRE_LIMIT;.
Definition at line 308 of file BufferParameters.h.
|
private |
Defaults to DEFAULT_QUADRANT_SEGMENTS;.
Definition at line 299 of file BufferParameters.h.