|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.operation.buffer.BufferOp
Computes the buffer of a geometry, for both positive and negative buffer distances.
In GIS, the buffer of a geometry is defined as the Minkowski sum or difference of the geometry with a circle with radius equal to the absolute value of the buffer distance. In the CAD/CAM world buffers are known as offset curves.
Since true buffer curves may contain circular arcs, computed buffer polygons can only be approximations to the true geometry. The user can control the accuracy of the curve approximation by specifying the number of linear segments with which to approximate a curve.
The end cap style of a linear buffer may be specified. The following end cap styles are supported:
CAP_ROUND
- the usual round end caps
CAP_BUTT
- end caps are truncated flat at the line ends
CAP_SQUARE
- end caps are squared off at the buffer distance beyond the line ends
The computation uses an algorithm involving iterated noding and precision reduction to provide a high degree of robustness.
Field Summary | |
static int |
CAP_BUTT
Specifies a butt (or flat) line buffer end cap style. |
static int |
CAP_ROUND
Specifies a round line buffer end cap style. |
static int |
CAP_SQUARE
Specifies a square line buffer end cap style. |
Constructor Summary | |
BufferOp(Geometry g)
Initializes a buffer computation for the given geometry |
Method Summary | |
static Geometry |
bufferOp(Geometry g,
double distance)
Computes the buffer of a geometry for a given buffer distance. |
static Geometry |
bufferOp(Geometry g,
double distance,
int quadrantSegments)
Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation. |
Geometry |
getResultGeometry(double distance)
Returns the buffer computed for a geometry for a given buffer distance. |
Geometry |
getResultGeometry(double distance,
int quadrantSegments)
Deprecated. use setQuadrantSegments instead |
void |
setEndCapStyle(int endCapStyle)
Specifies the end cap style of the generated buffer. |
void |
setQuadrantSegments(int quadrantSegments)
Specifies the end cap style of the generated buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CAP_ROUND
public static final int CAP_BUTT
public static final int CAP_SQUARE
Constructor Detail |
public BufferOp(Geometry g)
g
- the geometry to bufferMethod Detail |
public static Geometry bufferOp(Geometry g, double distance)
g
- the geometry to bufferdistance
- the buffer distance
public static Geometry bufferOp(Geometry g, double distance, int quadrantSegments)
g
- the geometry to bufferdistance
- the buffer distancequadrantSegments
- the number of segments used to approximate a quarter circle
public void setEndCapStyle(int endCapStyle)
CAP_ROUND
, CAP_BUTT
, and CAP_SQUARE
.
The default is CAP_ROUND.
endCapStyle
- the end cap style to specifypublic void setQuadrantSegments(int quadrantSegments)
CAP_ROUND
, CAP_BUTT
, and CAP_SQUARE
.
The default is CAP_ROUND.
public Geometry getResultGeometry(double distance)
distance
- the buffer distance
public Geometry getResultGeometry(double distance, int quadrantSegments)
distance
- the buffer distancequadrantSegments
- the number of segments used to approximate a quarter circle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |