coveredBy method

bool coveredBy(
  1. Geometry g
)

Tests whether this geometry is covered by the argument geometry.

The coveredBy predicate has the following equivalent definitions:

  • Every point of this geometry is a point of the other geometry.
  • The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns:
    • [T*F**F***]
    • [*TF**F***]
    • [**FT*F***]
    • [**F*TF***]
  • g.covers(this) = true
    (coveredBy is the converse of {@link #covers})
If either geometry is empty, the value of this predicate is false.

This predicate is similar to {@link #within}, but is more inclusive (i.e. returns true for more cases).

@param g the Geometry with which to compare this Geometry @return true if this Geometry is covered by g

@see Geometry#within @see Geometry#covers

Implementation

bool coveredBy(Geometry g) {
  return g.covers(this);
}