public interface ILcd2DAdvancedBinaryTopology
This interface allows to compute binary topology relations on ILcdShapes
based on a
dimensionally extended nine intersection matrix (DE-9IM).
A DE-9IM is a 3x3 matrix which stores information about the way two shapes are topologically related. Binary topology relations such as "Are these two shapes disjoint?" or "Is shape1 inside shape2?" can be evaluated by checking whether the intersection matrix of the corresponding shapes satisfies certain conditions. The specific conditions corresponding with a particular binary topology relation are implemented as an ILcdIntersectionMatrixPattern instance.
A code snippet demonstrating a typical usage of this interface is given below.
// Create the advanced binary topology.
ILcd2DAdvancedBinaryTopology topology =
new TLcdEllipsoidalAdvancedBinaryTopology(ellipsoid);
// Test if the shapes intersect and / or touch.
boolean intersects = topology.checkTopology(
polygon1,
polygon2,
ILcdIntersectionMatrixPattern.INTERSECTS
);
More information about the DE-9IM model can be found in the developer guide and in the following two papers:
ILcdIntersectionMatrix
,
ILcdIntersectionMatrixPattern
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.
|
ILcdIntersectionMatrix computeIntersectionMatrix(ILcdShape aShape1, ILcdShape aShape2)
aShape1
- the first shapeaShape2
- the second shapeboolean checkTopology(ILcdShape aShape1, ILcdShape aShape2, ILcdIntersectionMatrixPattern aMatrixPattern)
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.