public class CommonBitsOp
extends java.lang.Object
In the current implementation no rounding is performed on the reshifted result geometry, which means that it is possible that the returned Geometry is invalid. Client classes should check the validity of the returned result themselves.
Modifier and Type | Field and Description |
---|---|
private CommonBitsRemover |
cbr |
private boolean |
returnToOriginalPrecision |
Constructor and Description |
---|
CommonBitsOp()
Creates a new instance of class, which reshifts result
Geometry s. |
CommonBitsOp(boolean returnToOriginalPrecision)
Creates a new instance of class, specifying whether
the result
Geometry s should be reshifted. |
Modifier and Type | Method and Description |
---|---|
Geometry |
buffer(Geometry geom0,
double distance)
Computes the buffer a geometry,
using enhanced precision.
|
private Geometry |
computeResultPrecision(Geometry result)
If required, returning the result to the original precision if required.
|
Geometry |
difference(Geometry geom0,
Geometry geom1)
Computes the set-theoretic difference of two
Geometry s, using enhanced precision. |
Geometry |
intersection(Geometry geom0,
Geometry geom1)
Computes the set-theoretic intersection of two
Geometry s, using enhanced precision. |
private Geometry |
removeCommonBits(Geometry geom0)
Computes a copy of the input
Geometry with the calculated common bits
removed from each coordinate. |
private Geometry[] |
removeCommonBits(Geometry geom0,
Geometry geom1)
Computes a copy of each input
Geometry s with the calculated common bits
removed from each coordinate. |
Geometry |
symDifference(Geometry geom0,
Geometry geom1)
Computes the set-theoretic symmetric difference of two geometries,
using enhanced precision.
|
Geometry |
union(Geometry geom0,
Geometry geom1)
Computes the set-theoretic union of two
Geometry s, using enhanced precision. |
private boolean returnToOriginalPrecision
private CommonBitsRemover cbr
public CommonBitsOp()
Geometry
s.public CommonBitsOp(boolean returnToOriginalPrecision)
Geometry
s should be reshifted.returnToOriginalPrecision
- public Geometry intersection(Geometry geom0, Geometry geom1)
Geometry
s, using enhanced precision.geom0
- the first Geometrygeom1
- the second Geometrypublic Geometry union(Geometry geom0, Geometry geom1)
Geometry
s, using enhanced precision.geom0
- the first Geometrygeom1
- the second Geometrypublic Geometry difference(Geometry geom0, Geometry geom1)
Geometry
s, using enhanced precision.geom0
- the first Geometrygeom1
- the second Geometry, to be subtracted from the firstpublic Geometry symDifference(Geometry geom0, Geometry geom1)
geom0
- the first Geometrygeom1
- the second Geometrypublic Geometry buffer(Geometry geom0, double distance)
geom0
- the Geometry to bufferdistance
- the buffer distanceprivate Geometry computeResultPrecision(Geometry result)
In this current implementation, no rounding is performed on the reshifted result geometry, which means that it is possible that the returned Geometry is invalid.
result
- the result Geometry to modifyprivate Geometry removeCommonBits(Geometry geom0)
Geometry
with the calculated common bits
removed from each coordinate.geom0
- the Geometry to remove common bits fromprivate Geometry[] removeCommonBits(Geometry geom0, Geometry geom1)
Geometry
s with the calculated common bits
removed from each coordinate.geom0
- a Geometry to remove common bits fromgeom1
- a Geometry to remove common bits from