isEquals method

bool isEquals(
  1. int dimensionOfGeometryA,
  2. int dimensionOfGeometryB
)

Tests whether the argument dimensions are equal and this IntersectionMatrix matches the pattern TF**FFF.

Note: This pattern differs from the one stated in Simple feature access - Part 1: Common architecture. That document states the pattern as TFFFTFFFT. This would specify that two identical POINTs are not equal, which is not desirable behaviour. The pattern used here has been corrected to compute equality in this situation.

@param dimensionOfGeometryA the dimension of the first Geometry @param dimensionOfGeometryB the dimension of the second Geometry @return true if the two Geometrys related by this IntersectionMatrix are equal; the Geometrys must have the same dimension to be equal

Implementation

bool isEquals(int dimensionOfGeometryA, int dimensionOfGeometryB) {
  if (dimensionOfGeometryA != dimensionOfGeometryB) {
    return false;
  }
  return isTrue(matrix[Location.INTERIOR][Location.INTERIOR]) &&
      matrix[Location.INTERIOR][Location.EXTERIOR] == Dimension.FALSE &&
      matrix[Location.BOUNDARY][Location.EXTERIOR] == Dimension.FALSE &&
      matrix[Location.EXTERIOR][Location.INTERIOR] == Dimension.FALSE &&
      matrix[Location.EXTERIOR][Location.BOUNDARY] == Dimension.FALSE;
}