Package org.geotools.api.geometry
Interface BoundingBox3D
- All Superinterfaces:
BoundingBox,Bounds
- All Known Implementing Classes:
ReferencedEnvelope3D
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 Summary
Modifier and TypeMethodDescriptionbooleancontains(double x, double y, double z) Returnstrueif the provided location is contained by this bounding box.doublegetMaxZ()Provides the maximum ordinate along the third axis.doublegetMinZ()Provides the minimum ordinate along the third axis.voidinclude(double x, double y, double z) Includes the provided coordinates, expanding as necessary.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, setBoundsMethods inherited from interface Bounds
getCoordinateReferenceSystem, getDimension, getLowerCorner, getMaximum, getMedian, getMinimum, getSpan, getUpperCorner
-
Method Details
-
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) Returnstrueif 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:
trueif the given position is inside this bounds.
-
toBounds
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
boxis a bounding box using a geographic CRS with WGS84 datum, then one can write:
Be aware thatGeographicCRS 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:
toBoundsin 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.
-