/** Check if this bounding box intersects the provided bounds. */ @Override public ReferencedEnvelope intersection(Envelope env) { if (env instanceof BoundingBox) { BoundingBox bbox = (BoundingBox) env; ensureCompatibleReferenceSystem(bbox); } return new ReferencedEnvelope(super.intersection(env), this.getCoordinateReferenceSystem()); }
/** * Check if this bounding box intersects the provided bounds. * * @since 2.4 */ public boolean intersects(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); return super.intersects(getJTSEnvelope(bbox)); } /** Check if this bounding box intersects the provided bounds. */
/** * Returns {@code true} if the provided bounds are contained by this bounding box. * * @since 2.4 */ public boolean contains(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); return super.contains(getJTSEnvelope(bbox)); }
/** * Initialize the bounding box with another bounding box. * * @since 2.4 */ public void setBounds(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); super.init(getJTSEnvelope(bbox)); }
/** * Returns {@code true} if the provided location is contained by this bounding box. * * @since 2.4 */ public boolean contains(DirectPosition pos) { ensureCompatibleReferenceSystem(pos); return super.contains(pos.getOrdinate(0), pos.getOrdinate(1)); }
/** * Include the provided bounding box, expanding as necessary. * * @since 2.4 */ public void include(final BoundingBox bbox) { if (crs == null) { this.crs = bbox.getCoordinateReferenceSystem(); } else { ensureCompatibleReferenceSystem(bbox); } expandToInclude(ReferencedEnvelope.reference(bbox)); } /**
/** Include the provided envelope, expanding as necessary. */ @Override public void expandToInclude(Envelope other) { if (other instanceof BoundingBox) { if (other.isNull()) { return; } BoundingBox bbox = (BoundingBox) other; ensureCompatibleReferenceSystem(bbox); expandToInclude(bbox.getLowerCorner()); expandToInclude(bbox.getUpperCorner()); } else { super.expandToInclude(other); } }
/** * Initialize the bounding box with another bounding box. * * @since 2.4 */ public void setBounds(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); super.init(getJTSEnvelope(bbox)); }
/** * Returns {@code true} if the provided bounds are contained by this bounding box. * * @since 2.4 */ public boolean contains(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); return super.contains(getJTSEnvelope(bbox)); }
/** * Include the provided bounding box, expanding as necessary. * * @since 2.4 */ public void include(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); super.expandToInclude(getJTSEnvelope(bbox)); }
/** * Check if this bounding box intersects the provided bounds. * * @since 2.4 */ public boolean intersects(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); return super.intersects(getJTSEnvelope(bbox)); }