private <P extends C2D> boolean envelopeIntersect(Geometry<P> geometry1, Geometry<P> geometry2) { return (geometry1.getEnvelope().intersects(geometry2.getEnvelope())); }
/** * Returns the Morton code for the specified {@code Geometry}. * <p/> * <p>This method is equivalent to {@code ofEnvelope(geometry.getEnvelope())}. * * @param geometry a {code Geometry} value. * @return the morton code for the envelope of the specified {@code Geometry}. * @throws IllegalArgumentException if the geometry is null, or has an envelope which is not contained in * the spatial extent of this instance's {@code MortonContext} */ public String ofGeometry(Geometry<P> geometry) { checkForNull(geometry); return ofEnvelope(geometry.getEnvelope()); }
@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(); }