/** * Checks whether the specified {@code Point} is contained in the extent. * * @param pos a {@code Point} value * @return true if the specified point is contained in the extent, false otherwise * @throws IllegalArgumentException if the specified point does not share this extent's {@code CrsId} */ public boolean extentContains(P pos) { return this.extent.contains(pos); }
/** * Checks whether the specified {@code Envelope} is contained in the extent. * * @param envelope an {@code Envelope} value * @return true if the specified envelope is contained in the extent, false otherwise * @throws IllegalArgumentException if the specified envelope does not share this extent's {@code CrsId} */ public boolean extentContains(Envelope<P> envelope) { return this.extent.contains(envelope); }
@Override public <P extends C2D> boolean contains(final Geometry<P> geometry, final Geometry<P> other) { if (geometry.isEmpty() || other.isEmpty()) return Boolean.FALSE; checkCompatibleCRS(geometry, other); if (!geometry.getEnvelope().contains(other.getEnvelope())) return Boolean.FALSE; final RelateOp relateOp = new RelateOp(JTS.to(geometry), JTS.to(other)); return relateOp.getIntersectionMatrix().isContains(); }