Interface BoundingBox3D

  • All Superinterfaces:
    BoundingBox, Bounds
    All Known Implementing Classes:
    ReferencedEnvelope3D

    public interface BoundingBox3D
    extends BoundingBox
    Represents a three-dimensional envelope. Extends BoundingBox to support the third dimension. This interface combines the ideas of GeographicBoundingBox with those of Bounds. It provides convenience methods to assist in accessing the formal properties of this object.

    This object contains no additional information beyond that provided by Bounds.

    Author:
    Niels Charlier
    • Method Detail

      • getMinZ

        double getMinZ()
        Provides the minimum ordinate along the third axis. This is equivalent to getMinimum(2).
        Returns:
        The minimum ordinate along the third axis.
      • getMaxZ

        double getMaxZ()
        Provides the maximum ordinate along the third axis. This is equivalent to getMaximum(2).
        Returns:
        The maximum ordinate along the third axis.
      • include

        void include​(double x,
                     double y,
                     double z)
        Includes the provided coordinates, expanding as necessary. Note that there is no guarantee that the (x, x) values are oriented toward (East, North), since it depends on the envelope CRS.
        Parameters:
        x - The first ordinate value.
        y - The second ordinate value.
        z - The third ordinate value.
      • contains

        boolean contains​(double x,
                         double y,
                         double z)
        Returns true if the provided location is contained by this bounding box. Note that there is no guarantee that the (x, x) values are oriented toward (East, North), since it depends on the envelope CRS.
        Parameters:
        x - The first ordinate value.
        y - The second ordinate value.
        z - The second ordinate value.
        Returns:
        true if the given position is inside this bounds.
      • toBounds

        BoundingBox toBounds​(CoordinateReferenceSystem targetCRS)
                      throws TransformException
        Transforms this box to the specified CRS and returns a new bounding box for the transformed shape. This method provides a convenient (while not always efficient) way to get minimum and maximum ordinate values toward some specific axis directions, typically East and North.

        Example: if box is a bounding box using a geographic CRS with WGS84 datum, then one can write:

         GeographicCRS targetCRS   = crsAuthorityFactory.createGeographicCRS("EPSG:4326");
         BoundingBox   targetBox   = box.toBounds(targetCRS);
         double        minEasting  = targetBox.getMinY();
         double        minNorthing = targetBox.getMinX();
         
        Be aware that "EPSG:4326" has (latitude, longitude) axis order, thus the inversion of X and Y in the above code.

        Sophesticated applications will typically provide more efficient way to perform similar transformations in their context. For example Canvas store precomputed objective to display transforms.

        Specified by:
        toBounds in interface BoundingBox
        Parameters:
        targetCRS - The target CRS for the bounding box to be returned.
        Returns:
        A new bounding box wich includes the shape of this box transformed to the specified target CRS.
        Throws:
        TransformException - if no transformation path has been found from this box CRS to the specified target CRS, or if the transformation failed for an other reason.