public class BufferOp extends Object
In GIS, the positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle of radius equal to the absolute value of the buffer distance. In the CAD/CAM world buffers are known as offset curves. In morphological analysis the operation of postive and negative buffering is referred to as erosion and dilation
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty Polygon.
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 used to approximate curves.
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 | Modifier and Type | Field and Description |
|---|---|
static int |
CAP_BUTT
Deprecated.
use BufferParameters
|
static int |
CAP_FLAT
Deprecated.
use BufferParameters
|
static int |
CAP_ROUND
Deprecated.
use BufferParameters
|
static int |
CAP_SQUARE
Deprecated.
use BufferParameters
|
| Constructor and Description |
|---|
BufferOp(Geometry
Initializes a buffer computation for the given geometry
|
BufferOp(Geometry
Initializes a buffer computation for the given geometry with the given set of parameters
|
| Modifier and Type | Method and Description |
|---|---|
static Geometry |
bufferOp(Geometry
Computes the buffer of a geometry for a given buffer distance.
|
static Geometry |
bufferOp(Geometry
Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation.
|
static Geometry |
bufferOp(Geometry
Comutes the buffer for a geometry for a given buffer distance and accuracy of approximation.
|
static Geometry |
bufferOp(Geometry
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.
|
void |
setEndCapStyle(int endCapStyle)
Specifies the end cap style of the generated buffer.
|
void |
setQuadrantSegments(int quadrantSegments)
Sets the number of segments used to approximate a angle fillet
|
public static final int CAP_ROUND
public static final int CAP_BUTT
public static final int CAP_FLAT
public static final int CAP_SQUARE
public BufferOp(Geometryg)
g - the geometry to buffer
public BufferOp(Geometryg, BufferParameters bufParams)
g - the geometry to buffer
bufParams - the buffer parameters to use
public static GeometrybufferOp(Geometry g, double distance)
g - the geometry to buffer
distance - the buffer distance
public static GeometrybufferOp(Geometry g, double distance, BufferParameters params)
g - the geometry to buffer
distance - the buffer distance
params - the buffer parameters to use
public static GeometrybufferOp(Geometry g, double distance, int quadrantSegments)
g - the geometry to buffer
distance - the buffer distance
quadrantSegments - the number of segments used to approximate a quarter circle
public static GeometrybufferOp(Geometry g, double distance, int quadrantSegments, int endCapStyle)
g - the geometry to buffer
distance - the buffer distance
quadrantSegments - the number of segments used to approximate a quarter circle
endCapStyle - the end cap style to use
public void setEndCapStyle(int endCapStyle)
CAP_ROUND,
CAP_BUTT, and
CAP_SQUARE. The default is CAP_ROUND.
endCapStyle - the end cap style to specify
public void setQuadrantSegments(int quadrantSegments)
quadrantSegments - the number of segments in a fillet for a quadrant
public GeometrygetResultGeometry(double distance)
distance - the buffer distance