Package org.geotools.api.geometry
Interface Bounds
-
- All Known Subinterfaces:
BoundingBox,BoundingBox3D
- All Known Implementing Classes:
AbstractBounds,CRSEnvelope,Envelope2DArchived,GeneralBounds,ReferencedEnvelope,ReferencedEnvelope3D
public interface BoundsA minimum bounding box or rectangle. Regardless of dimension, anEnvelopecan be represented without ambiguity as two direct positions (coordinate points). To encode anEnvelope, it is sufficient to encode these two points. This is consistent with all of the data types in this specification, their state is represented by their publicly accessible attributes.- Since:
- GeoAPI 1.0
- Author:
- Martin Desruisseaux (IRD)
- See Also:
GridEnvelope
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CoordinateReferenceSystemgetCoordinateReferenceSystem()Returns the envelope coordinate reference system, ornullif unknown.intgetDimension()The length of coordinate sequence (the number of entries) in this envelope.PositiongetLowerCorner()A coordinate position consisting of all the minimal ordinates for each dimension for all points within theEnvelope.doublegetMaximum(int dimension)Returns the maximal ordinate along the specified dimension.doublegetMedian(int dimension)Returns the median ordinate along the specified dimension.doublegetMinimum(int dimension)Returns the minimal ordinate along the specified dimension.doublegetSpan(int dimension)Returns the envelope span (typically width or height) along the specified dimension.PositiongetUpperCorner()A coordinate position consisting of all the maximal ordinates for each dimension for all points within theEnvelope.
-
-
-
Method Detail
-
getCoordinateReferenceSystem
CoordinateReferenceSystem getCoordinateReferenceSystem()
Returns the envelope coordinate reference system, ornullif unknown. If non-null, it shall be the same as lower corner and upper corner CRS.- Returns:
- The envelope CRS, or
nullif unknown. - Since:
- GeoAPI 2.1
-
getDimension
int getDimension()
The length of coordinate sequence (the number of entries) in this envelope. Mandatory even when the coordinate reference system is unknown.- Returns:
- The dimensionality of this envelope.
- Since:
- GeoAPI 2.0
-
getLowerCorner
Position getLowerCorner()
A coordinate position consisting of all the minimal ordinates for each dimension for all points within theEnvelope.- Returns:
- The lower corner.
-
getUpperCorner
Position getUpperCorner()
A coordinate position consisting of all the maximal ordinates for each dimension for all points within theEnvelope.- Returns:
- The upper corner.
-
getMinimum
double getMinimum(int dimension) throws IndexOutOfBoundsExceptionReturns the minimal ordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporaryPositionobject:getLowerCorner().getOrdinate(dimension)- Parameters:
dimension- The dimension for which to obtain the ordinate value.- Returns:
- The minimal ordinate at the given dimension.
- Throws:
IndexOutOfBoundsException- If the given index is negative or is equals or greater than the envelope dimension.- Since:
- GeoAPI 2.0
- See Also:
RectangularShape.getMinX(),RectangularShape.getMinY()
-
getMaximum
double getMaximum(int dimension) throws IndexOutOfBoundsExceptionReturns the maximal ordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporaryPositionobject:getUpperCorner().getOrdinate(dimension)- Parameters:
dimension- The dimension for which to obtain the ordinate value.- Returns:
- The maximal ordinate at the given dimension.
- Throws:
IndexOutOfBoundsException- If the given index is negative or is equals or greater than the envelope dimension.- Since:
- GeoAPI 2.0
- See Also:
RectangularShape.getMaxX(),RectangularShape.getMaxY()
-
getMedian
double getMedian(int dimension) throws IndexOutOfBoundsExceptionReturns the median ordinate along the specified dimension. The result should be equals (minus rounding error) to:(getMinimum(dimension) + getMaximum(dimension)) / 2- Parameters:
dimension- The dimension for which to obtain the ordinate value.- Returns:
- The median ordinate at the given dimension.
- Throws:
IndexOutOfBoundsException- If the given index is negative or is equals or greater than the envelope dimension.- Since:
- GeoAPI 2.2
- See Also:
RectangularShape.getCenterX(),RectangularShape.getCenterY()
-
getSpan
double getSpan(int dimension) throws IndexOutOfBoundsExceptionReturns the envelope span (typically width or height) along the specified dimension. The result should be equals (minus rounding error) to:getMaximum(dimension) - getMinimum(dimension)- Parameters:
dimension- The dimension for which to obtain the ordinate value.- Returns:
- The span (typically width or height) at the given dimension.
- Throws:
IndexOutOfBoundsException- If the given index is negative or is equals or greater than the envelope dimension.- Since:
- GeoAPI 2.2
- See Also:
RectangularShape.getWidth(),RectangularShape.getHeight()
-
-