public class TLcdEllipsoidalAdvancedBinaryTopology extends Object implements ILcd2DAdvancedBinaryTopology
ILcd2DAdvancedBinaryTopology
on an ellipsoidal model.
This implementation currently supports instances of the following interfaces:
Cartesian geometry (e.g. TLcdXYPolyline) is supported by this implementation. Straight lines are treated as geodesic lines (i.e the coordinates of a cartesian geometry are interpreted as lon/lat coordinates).
The current implementation caches (intermediate) results for ILcdShape instances which implement the ILcdCache
interface.
When performing repeated checks with the same shape or shapes, it is generally more efficient to reuse the same ILcd2DAdvancedBinaryTopology
object,
instead of creating a new instance for every check.
Constructor and Description |
---|
TLcdEllipsoidalAdvancedBinaryTopology(ILcdEllipsoid aEllipsoid)
Constructor for TLcdEllipsoidalAdvancedBinaryTopology
|
TLcdEllipsoidalAdvancedBinaryTopology(ILcdEllipsoid aEllipsoid,
double aTolerance)
Constructor for TLcdEllipsoidalAdvancedBinaryTopology allowing to specify a tolerance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkTopology(ILcdShape aShape1,
ILcdShape aShape2,
ILcdIntersectionMatrixPattern aMatrixPattern)
Checks whether the two given shapes satisfy the binary topology relation defined by the given
matrix pattern.
|
ILcdIntersectionMatrix |
computeIntersectionMatrix(ILcdShape aShape1,
ILcdShape aShape2)
Computes the intersection matrix of the two given shapes.
|
ILcdEllipsoid |
getEllipsoid()
Returns the ellipsoid on which the binary topology relations are computed
|
double |
getTolerance()
Returns the tolerance value (expressed in meters) used in the binary topology computations
when checking the equality of two points.
|
void |
setEllipsoid(ILcdEllipsoid aEllipsoid)
Sets the ellipsoid on which the binary topology relations are computed
|
void |
setTolerance(double aTolerance)
Sets the tolerance value used in the binary topology computations when checking the equality
of two points.
|
public TLcdEllipsoidalAdvancedBinaryTopology(ILcdEllipsoid aEllipsoid)
aEllipsoid
- ellipsoid on which the binary topology relations are computed.public TLcdEllipsoidalAdvancedBinaryTopology(ILcdEllipsoid aEllipsoid, double aTolerance)
Constructor for TLcdEllipsoidalAdvancedBinaryTopology allowing to specify a tolerance.
In some cases, the result obtained when checking the topological relation between two shapes depends on the accuracy of the data used to represent both shapes.
For example, you would expect that neighboring countries touch but not overlap. However, if the contours of the polygons used to represent both countries slightly cross at the common border (due to small errors in the data), the calculations would lead to the opposite result.
This constructor allow you to set a tolerance value which is taken into account in the topology calculations. Points that lie within this tolerance value from each other are considered to be coincident.
aTolerance
- tolerance value (expressed in meters) used to determine the equality of
two points in the topology calculations. This value should be larger than 0.01m.aEllipsoid
- ellipsoid on which the binary topology relations are computed.public ILcdIntersectionMatrix computeIntersectionMatrix(ILcdShape aShape1, ILcdShape aShape2)
ILcd2DAdvancedBinaryTopology
computeIntersectionMatrix
in interface ILcd2DAdvancedBinaryTopology
aShape1
- the first shapeaShape2
- the second shapepublic boolean checkTopology(ILcdShape aShape1, ILcdShape aShape2, ILcdIntersectionMatrixPattern aMatrixPattern)
ILcd2DAdvancedBinaryTopology
checkTopology
in interface ILcd2DAdvancedBinaryTopology
aShape1
- the first shapeaShape2
- the second shapeaMatrixPattern
- the matrix pattern defining the binary topology relation to be checkedtrue
if the binary topology relation defined by
aMatrixPattern
holds true
for aShape1
and
aShape2
, false otherwise.public double getTolerance()
public void setTolerance(double aTolerance)
aTolerance
- tolerance value (expressed in meters) used in the binary topology computations.public ILcdEllipsoid getEllipsoid()
public void setEllipsoid(ILcdEllipsoid aEllipsoid)
aEllipsoid
- ellipsoid on which the binary topology relations are computed.