Package org.geotools.api.coverage.grid
Interface GridEnvelope
-
- All Known Implementing Classes:
GeneralGridEnvelope
,GridEnvelope2D
public interface GridEnvelope
Provides the grid coordinate values for the diametrically opposed corners of the grid.Remark that both corners are inclusive. Thus the number of elements in the direction of the first axis is
getHigh(0) - getLow(0) + 1
. This is the opposite of Java2D usage where maximal values inRectangle
(as computed by getMaxX() and getMaxY()) are exclusive.- Since:
- GeoAPI 2.1
- Author:
- Wim Koolhoven, Martin Schouwenburg
- See Also:
Bounds
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getDimension()
Returns the number of dimensions.GridCoordinates
getHigh()
Returns the maximal coordinate values for all grid points within the grid.int
getHigh(int dimension)
Returns the valid maximum inclusive grid coordinate along the specified dimension.GridCoordinates
getLow()
Returns the minimal coordinate values for all grid points within the grid.int
getLow(int dimension)
Returns the valid minimum inclusive grid coordinate along the specified dimension.int
getSpan(int dimension)
Returns the number of integer grid coordinates along the specified dimension.
-
-
-
Method Detail
-
getDimension
int getDimension()
Returns the number of dimensions. It must be equals to the number of dimensions of low and high grid coordinates.- Returns:
- The number of dimensions.
- Since:
- GeoAPI 2.2
-
getLow
GridCoordinates getLow()
Returns the minimal coordinate values for all grid points within the grid.- Returns:
- The minimal coordinate values for all grid points, inclusive.
-
getHigh
GridCoordinates getHigh()
Returns the maximal coordinate values for all grid points within the grid.- Returns:
- The maximal coordinate values for all grid points, inclusive.
-
getLow
int getLow(int dimension) throws IndexOutOfBoundsException
Returns the valid minimum inclusive grid coordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporaryGridCoordinates
object:getLow().getCoordinateValue(dimension)
- Parameters:
dimension
- The dimension for which to obtain the coordinate value.- Returns:
- The coordinate value at the given dimension, inclusive.
- Throws:
IndexOutOfBoundsException
- If the given index is negative or is equals or greater than the grid dimension.- Since:
- GeoAPI 2.2
- See Also:
Rectangle.x
,Rectangle.y
-
getHigh
int getHigh(int dimension) throws IndexOutOfBoundsException
Returns the valid maximum inclusive grid coordinate along the specified dimension. This is a shortcut for the following without the cost of creating a temporaryGridCoordinates
object:getHigh().getCoordinateValue(dimension)
- Parameters:
dimension
- The dimension for which to obtain the coordinate value.- Returns:
- The coordinate value at the given dimension, inclusive.
- Throws:
IndexOutOfBoundsException
- If the given index is negative or is equals or greater than the grid dimension.- Since:
- GeoAPI 2.2
-
getSpan
int getSpan(int dimension) throws IndexOutOfBoundsException
Returns the number of integer grid coordinates along the specified dimension. This is equals to:getHigh(dimension) - getLow(dimension) + 1
- Parameters:
dimension
- The dimension for which to obtain the coordinate value.- Returns:
- The coordinate value at the given dimension.
- Throws:
IndexOutOfBoundsException
- If the given index is negative or is equals or greater than the grid dimension.- Since:
- GeoAPI 2.2
- See Also:
Rectangle.width
,Rectangle.height
-
-