@Test public void testContainsDirectPosition() { boolean testContains; DirectPosition2D positionInAustralia = new DirectPosition2D(crs, 30, 120); DirectPosition2D positionOutsideAustralia = new DirectPosition2D(crs, 30, 170); try { testContains = australia.contains((DirectPosition) positionOutsideAustralia); assertFalse(testContains); } catch (MismatchedReferenceSystemException t) { fail("Expected a match of CoordinateReferenceSystem"); } try { testContains = australia.contains((DirectPosition) positionInAustralia); assertTrue(testContains); } catch (MismatchedReferenceSystemException t) { fail("Expected a match of CoordinateReferenceSystem"); } }
public boolean contains(BoundingBox bounds) { ensureCompatibleReferenceSystem(bounds); if (isEmpty() || bounds.isEmpty()) { return false; } return bounds.getMinX() >= this.getMinX() && bounds.getMaxX() <= this.getMaxX() && bounds.getMinY() >= this.getMinY() && bounds.getMaxY() <= this.getMaxY(); }
Envelope2D extends Rectangle2D.Double implements BoundingBox, Envelope, Cloneable { public boolean contains(BoundingBox bounds) { ensureCompatibleReferenceSystem(bounds); if (isEmpty() || bounds.isEmpty()) { return false; } return bounds.getMinX() >= this.getMinX() && bounds.getMaxX() <= this.getMaxX() && bounds.getMinY() >= this.getMinY() && bounds.getMaxY() <= this.getMaxY(); } }
Envelope2D extends Rectangle2D.Double implements BoundingBox, Envelope, Cloneable { public boolean contains(BoundingBox bounds) { ensureCompatibleReferenceSystem(bounds); if (isEmpty() || bounds.isEmpty()) { return false; } return bounds.getMinX() >= this.getMinX() && bounds.getMaxX() <= this.getMaxX() && bounds.getMinY() >= this.getMinY() && bounds.getMaxY() <= this.getMaxY(); } Envelope2D();  Envelope2D(final CoordinateReferenceSystem crs);  Envelope2D(final Envelope envelope);  Envelope2D(final CoordinateReferenceSystem crs, final Rectangle2D rect);  Envelope2D(
            final CoordinateReferenceSystem crs,
            final double x,
            final double y,
            final double width,
            final double height);  Envelope2D(final DirectPosition2D minDP, final DirectPosition2D maxDP); }
Envelope2D extends Rectangle2D.Double implements BoundingBox, Envelope, Cloneable { public boolean contains(BoundingBox bounds) { ensureCompatibleReferenceSystem(bounds); if (isEmpty() || bounds.isEmpty()) { return false; } return bounds.getMinX() >= this.getMinX() && bounds.getMaxX() <= this.getMaxX() && bounds.getMinY() >= this.getMinY() && bounds.getMaxY() <= this.getMaxY(); } Envelope2D();  Envelope2D(final CoordinateReferenceSystem crs);  Envelope2D(final Envelope envelope);  Envelope2D(final CoordinateReferenceSystem crs, final Rectangle2D rect);  Envelope2D(
            final CoordinateReferenceSystem crs,
            final double x,
            final double y,
            final double width,
            final double height);  Envelope2D(final DirectPosition2D minDP, final DirectPosition2D maxDP); final CoordinateReferenceSystem getCoordinateReferenceSystem(); void setCoordinateReferenceSystem(final CoordinateReferenceSystem crs); final int getDimension(); DirectPosition getLowerCorner(); DirectPosition getUpperCorner(); final double getMinimum(final int dimension); final double getMaximum(final int dimension); final double getMedian(final int dimension); final double getSpan(final int dimension); @Override int hashCode(); @Override boolean equals(final Object object); boolean boundsEquals(final Envelope that, final int xDim, final int yDim, double eps); @Override String toString(); void setBounds(BoundingBox bounds); void include(BoundingBox bounds); void include(double x, double y); boolean intersects(BoundingBox bounds); boolean contains(BoundingBox bounds); boolean contains(DirectPosition location); BoundingBox toBounds(CoordinateReferenceSystem targetCRS); }
Envelope2D extends Rectangle2D.Double implements BoundingBox, Envelope, Cloneable { public boolean contains(BoundingBox bounds) { ensureCompatibleReferenceSystem(bounds); if (isEmpty() || bounds.isEmpty()) { return false; } return bounds.getMinX() >= this.getMinX() && bounds.getMaxX() <= this.getMaxX() && bounds.getMinY() >= this.getMinY() && bounds.getMaxY() <= this.getMaxY(); } Envelope2D();  Envelope2D(final CoordinateReferenceSystem crs);  Envelope2D(final Envelope envelope);  Envelope2D(final CoordinateReferenceSystem crs, final Rectangle2D rect);  Envelope2D(
            final CoordinateReferenceSystem crs,
            final double x,
            final double y,
            final double width,
            final double height);  Envelope2D(final DirectPosition2D minDP, final DirectPosition2D maxDP); final CoordinateReferenceSystem getCoordinateReferenceSystem(); void setCoordinateReferenceSystem(final CoordinateReferenceSystem crs); final int getDimension(); DirectPosition getLowerCorner(); DirectPosition getUpperCorner(); final double getMinimum(final int dimension); final double getMaximum(final int dimension); final double getMedian(final int dimension); final double getSpan(final int dimension); @Override int hashCode(); @Override boolean equals(final Object object); boolean boundsEquals(final Envelope that, final int xDim, final int yDim, double eps); @Override String toString(); void setBounds(BoundingBox bounds); void include(BoundingBox bounds); void include(double x, double y); boolean intersects(BoundingBox bounds); boolean contains(BoundingBox bounds); boolean contains(DirectPosition location); BoundingBox toBounds(CoordinateReferenceSystem targetCRS);  }