Package org.geotools.api.geometry
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 ofGeographicBoundingBox
with those ofBounds
. 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(double x, double y, double z)
Returnstrue
if the provided location is contained by this bounding box.double
getMaxZ()
Provides the maximum ordinate along the third axis.double
getMinZ()
Provides the minimum ordinate along the third axis.void
include(double x, double y, double z)
Includes the provided coordinates, expanding as necessary.BoundingBox
toBounds(CoordinateReferenceSystem targetCRS)
Transforms this box to the specified CRS and returns a new bounding box for the transformed shape.-
Methods inherited from interface BoundingBox
contains, contains, contains, getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth, include, include, intersects, isEmpty, setBounds
-
Methods inherited from interface Bounds
getCoordinateReferenceSystem, getDimension, getLowerCorner, getMaximum, getMedian, getMinimum, getSpan, getUpperCorner
-
-
-
-
Method Detail
-
getMinZ
double getMinZ()
Provides the minimum ordinate along the third axis. This is equivalent togetMinimum(2)
.- Returns:
- The minimum ordinate along the third axis.
-
getMaxZ
double getMaxZ()
Provides the maximum ordinate along the third axis. This is equivalent togetMaximum(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)
Returnstrue
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();
"EPSG:4326"
has (latitude, longitude) axis order, thus the inversion of X and Y in the above code.Sophisticated applications will typically provide more efficient way to perform similar transformations in their context.
- Specified by:
toBounds
in interfaceBoundingBox
- Parameters:
targetCRS
- The target CRS for the bounding box to be returned.- Returns:
- A new bounding box which 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.
-
-