equalsTopo method

bool equalsTopo(
  1. Geometry g
)

Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS equals predicate.

The SFS equals predicate has the following equivalent definitions:

  • The two geometries have at least one point in common, and no point of either geometry lies in the exterior of the other geometry.
  • The DE-9IM Intersection Matrix for the two geometries matches the pattern T*F**FFF*
    T*F
    **F
    FF*
    
Note that this method computes topologically equality. For structural equality, see {@link #equalsExact(Geometry)}.

@param g the Geometry with which to compare this Geometry @return true if the two Geometrys are topologically equal

@see #equalsExact(Geometry)

Implementation

bool equalsTopo(Geometry g) {
  // short-circuit test
  if (getEnvelopeInternal() != g.getEnvelopeInternal()) return false;
  return relate(g).isEquals(getDimension(), g.getDimension());
}