Interface ILcd2DAdvancedBinaryTopology

All Known Implementing Classes:
TLcdCartesianAdvancedBinaryTopology, TLcdEllipsoidalAdvancedBinaryTopology, TLcdSphericalAdvancedBinaryTopology

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:

  • Egenhofer M.J. and Herring J., Categorizing binary topological relationships between regions, lines and points in geographic databases, Tech. Report, Department of Surveying Engineering, University of Maine, Orono, ME 1991.
  • Clementini E. and Di Felice P., A Comparison of Methods for Representing Topological Relationships, Information Sciences 80, 1-34, 1994.
Since:
10.0
See Also:
  • Method Details

    • computeIntersectionMatrix

      ILcdIntersectionMatrix computeIntersectionMatrix(ILcdShape aShape1, ILcdShape aShape2)
      Computes the intersection matrix of the two given shapes. Both shapes must be in the same coordinate system.
      Parameters:
      aShape1 - the first shape
      aShape2 - the second shape
      Returns:
      the intersection matrix of the two given shapes
    • checkTopology

      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. Both shapes must be in the same coordinate system.
      Parameters:
      aShape1 - the first shape
      aShape2 - the second shape
      aMatrixPattern - the matrix pattern defining the binary topology relation to be checked
      Returns:
      true if the binary topology relation defined by aMatrixPattern holds true for aShape1 and aShape2, false otherwise.