Пример #1
0
 /**
  * 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);
   }
   super.expandToInclude(getJTSEnvelope(bbox));
 }
Пример #2
0
 /** Check if this bounding box intersects the provided bounds. */
 @Override
 public Envelope intersection(Envelope env) {
   if (env instanceof BoundingBox) {
     BoundingBox bbox = (BoundingBox) env;
     ensureCompatibleReferenceSystem(bbox);
   }
   return super.intersection(env);
 }
Пример #3
0
  /** 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);
    }
  }
Пример #4
0
 /**
  * Initialize the bounding box with another bounding box.
  *
  * @since 2.4
  */
 public void setBounds(final BoundingBox bbox) {
   ensureCompatibleReferenceSystem(bbox);
   super.init(getJTSEnvelope(bbox));
 }
Пример #5
0
  /**
   * 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));
  }
Пример #6
0
 /**
  * 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));
 }