| java.lang.Object org.geotools.coverage.grid.GeneralGridGeometry org.geotools.coverage.grid.GridGeometry2D
GridGeometry2D | public class GridGeometry2D extends GeneralGridGeometry (Code) | | Describes the valid range of grid coordinates and the math transform, in the special case
where only 2 dimensions are in use. By "in use", we means dimension with more than 1 pixel.
For example a grid size of 512×512×1 pixels can be represented by this
GridGeometry2D class (some peoples said 2.5D) because a two-dimensional grid
coordinate is enough for referencing a pixel without ambiguity. But a grid size of
512×512×2 pixels can not be represented by this
GridGeometry2D ,
because a three-dimensional coordinate is mandatory for referencing a pixel without
ambiguity.
since: 2.1 version: $Id: GridGeometry2D.java 27070 2007-09-19 16:14:49Z desruisseaux $ author: Martin Desruisseaux |
Constructor Summary | |
| GridGeometry2D(GridGeometry2D gm, CoordinateReferenceSystem crs) Constructs a new grid geometry identical to the specified one except for the CRS.
Note that this constructor just defines the CRS; it does not reproject
the envelope. | public | GridGeometry2D(GridRange gridRange, MathTransform gridToCRS, CoordinateReferenceSystem crs) Constructs a new grid geometry from a math transform. | public | GridGeometry2D(GridRange gridRange, Envelope userRange) Constructs a new grid geometry from an envelope. | public | GridGeometry2D(GridRange gridRange, Envelope userRange, boolean[] reverse, boolean swapXY) Constructs a new grid geometry from an envelope. | public | GridGeometry2D(Rectangle gridRange, Rectangle2D userRange) Constructs a new two-dimensional grid geometry. |
Method Summary | |
public boolean | equals(Object object) Compares the specified object with this grid geometry for equality. | public CoordinateReferenceSystem | getCoordinateReferenceSystem2D() Returns the two-dimensional part of this grid geometry CRS. | public Envelope2D | getEnvelope2D() Returns the two-dimensional bounding box for the coverage domain in coordinate reference
system coordinates. | public Rectangle | getGridRange2D() Returns the two-dimensional part of the
as a rectangle. | public MathTransform | getGridToCRS(PixelOrientation orientation) Returns a math transform mapping the specified pixel part.
Parameters: orientation - The pixel part to map. | public MathTransform2D | getGridToCRS2D() Returns a math transform for the two dimensional part. | public MathTransform2D | getGridToCRS2D(PixelOrientation orientation) Returns a math transform for the two dimensional part. | public MathTransform2D | getGridToCoordinateSystem2D() | public static Point2D | getPixelTranslation(PixelOrientation orientation) Returns the specified position relative to the pixel center.
This method returns a value from the following table:
Pixel orientation | x | y |
PixelOrientation.CENTER CENTER | 0.0 | 0.0 |
PixelOrientation.UPPER_LEFT UPPER_LEFT | -0.5 | -0.5 |
PixelOrientation.UPPER_RIGHT UPPER_RIGHT | +0.5 | -0.5 |
PixelOrientation.LOWER_LEFT LOWER_LEFT | -0.5 | +0.5 |
PixelOrientation.LOWER_RIGHT LOWER_RIGHT | +0.5 | +0.5 |
Parameters: orientation - The pixel orientation. | final Point2D | inverseTransform(Point2D point) Transforms a point using the inverse of
GridGeometry2D.getGridToCRS2D() .
Parameters: point - The point in logical coordinate system. | final Rectangle | inverseTransform(Rectangle2D bounds) Returns the pixel coordinate of a rectangle containing the
specified geographic area. |
gridDimensionXgridDimensionY | final public int gridDimensionXgridDimensionY(Code) | | The first (
gridDimensionX ) and second (
gridDimensionY ) dimensions of
with
greater than 1. Those (x, y) dimensions are usually 0 and 1
respectively.
|
GridGeometry2D | GridGeometry2D(GridGeometry2D gm, CoordinateReferenceSystem crs)(Code) | | Constructs a new grid geometry identical to the specified one except for the CRS.
Note that this constructor just defines the CRS; it does not reproject
the envelope. For this reason, this constructor should not be public. It is for internal
use by
GridCoverageFactory only.
|
GridGeometry2D | public GridGeometry2D(GridRange gridRange, MathTransform gridToCRS, CoordinateReferenceSystem crs) throws IllegalArgumentException, MismatchedDimensionException(Code) | | Constructs a new grid geometry from a math transform. The arguments are passed unchanged
to the
. However, they must obey to one
additional constraint: only two dimensions in the grid range can have a
larger than 1.
Parameters: gridRange - The valid coordinate range of a grid coverage, or null if none.The lowest valid grid coordinate is zero for BufferedImage, but maybe non-zero for arbitrary RenderedImage. A grid with 512 cells can have aminimum coordinate of 0 and maximum of 512, with 511 as the highest valid index. Parameters: gridToCRS - The math transform which allows for the transformationsfrom grid coordinates (pixel's center) to real world earth coordinates. Parameters: crs - The coordinate reference system for the "real world" coordinates, or null if unknown. This CRS is given to the . throws: MismatchedDimensionException - if the math transform and the CRS doesn't haveconsistent dimensions. throws: IllegalArgumentException - if gridRange has more than 2 dimensions witha larger than 1, or if the math transformcan't transform coordinates in the domain of the specified grid range. See Also: RenderedImage.getMinX See Also: RenderedImage.getMinY See Also: RenderedImage.getWidth See Also: RenderedImage.getHeight since: 2.2 |
GridGeometry2D | public GridGeometry2D(GridRange gridRange, Envelope userRange) throws IllegalArgumentException, MismatchedDimensionException(Code) | | Constructs a new grid geometry from an envelope. This constructors applies the same heuristic
rules than the
. However, they must obey to one additional constraint: only two
dimensions in the grid range can have a
larger than
1.
Parameters: gridRange - The valid coordinate range of a grid coverage. Parameters: userRange - The corresponding coordinate range in user coordinate. throws: IllegalArgumentException - if gridRange has more than 2 dimensions witha larger than 1. throws: MismatchedDimensionException - if the grid range and the CRS doesn't haveconsistent dimensions. since: 2.2 |
GridGeometry2D | public GridGeometry2D(GridRange gridRange, Envelope userRange, boolean[] reverse, boolean swapXY) throws IllegalArgumentException, MismatchedDimensionException(Code) | | Constructs a new grid geometry from an envelope. The argument are passed unchanged to the
. However, they must obey to one additional constraint:
only two dimensions in the grid range can have a
larger than 1.
Parameters: gridRange - The valid coordinate range of a grid coverage. Parameters: userRange - The corresponding coordinate range in user coordinate. Parameters: reverse - Tells for each axis in user space whatever or not itsdirection should be reversed. A null value reverse no axis. Parameters: swapXY - If true , then the two first axis will be interchanged. throws: IllegalArgumentException - if gridRange has more than 2 dimensions witha larger than 1. throws: MismatchedDimensionException - if the grid range and the CRS doesn't haveconsistent dimensions. since: 2.2 |
GridGeometry2D | public GridGeometry2D(Rectangle gridRange, Rectangle2D userRange)(Code) | | Constructs a new two-dimensional grid geometry. A math transform will be computed
automatically with an inverted y axis (i.e.
gridRange and
userRange are assumed to have y axis in opposite direction).
Parameters: gridRange - The valid coordinate range of a grid coverage.Increasing x values goes right andincreasing y values goes down. Parameters: userRange - The corresponding coordinate range in user coordinate.Increasing x values goes right andincreasing y values goes up.This rectangle must contains entirely all pixels, i.e.the rectangle's upper left corner must coincide withthe upper left corner of the first pixel and the rectangle'slower right corner must coincide with the lower right cornerof the last pixel. |
equals | public boolean equals(Object object)(Code) | | Compares the specified object with this grid geometry for equality.
|
getEnvelope2D | public Envelope2D getEnvelope2D() throws InvalidGridGeometryException(Code) | | Returns the two-dimensional bounding box for the coverage domain in coordinate reference
system coordinates. If the coverage envelope has more than two dimensions, only the
dimensions used in the underlying rendered image are returned.
The bounding box in "real world" coordinates (never null ). throws: InvalidGridGeometryException - if this grid geometry has no envelope (i.e.() returned false ). See Also: GridGeometry2D.getEnvelope |
getGridToCRS | public MathTransform getGridToCRS(PixelOrientation orientation)(Code) | | Returns a math transform mapping the specified pixel part.
Parameters: orientation - The pixel part to map. The default value isPixelOrientation.CENTER CENTER. The transform which allows for the transformations from grid coordinatesto real world earth coordinates. throws: InvalidGridGeometryException - if a transform is not availablefor this grid geometry. since: 2.3 |
getGridToCRS2D | public MathTransform2D getGridToCRS2D() throws InvalidGridGeometryException(Code) | | Returns a math transform for the two dimensional part. This is a convenience method for
working on horizontal data while ignoring vertical or temporal dimensions.
The transform which allows for the transformations from grid coordinatesto real world earth coordinates, operating only on two dimensions.The returned transform is often an instance of AffineTransform, whichmake it convenient for interoperability with Java2D. throws: InvalidGridGeometryException - if a two-dimensional transform is not availablefor this grid geometry. See Also: GridGeometry2D.getGridToCRS since: 2.3 |
getGridToCRS2D | public MathTransform2D getGridToCRS2D(PixelOrientation orientation)(Code) | | Returns a math transform for the two dimensional part. This method is similar
to
GridGeometry2D.getGridToCRS2D() except that the transform may maps a pixel corner
instead of pixel center.
Parameters: orientation - The pixel part to map. The default value isPixelOrientation.CENTER CENTER. The transform which allows for the transformations from grid coordinatesto real world earth coordinates. throws: InvalidGridGeometryException - if a two-dimensional transform is not availablefor this grid geometry. since: 2.3 |
getPixelTranslation | public static Point2D getPixelTranslation(PixelOrientation orientation) throws IllegalArgumentException(Code) | | Returns the specified position relative to the pixel center.
This method returns a value from the following table:
Pixel orientation | x | y |
PixelOrientation.CENTER CENTER | 0.0 | 0.0 |
PixelOrientation.UPPER_LEFT UPPER_LEFT | -0.5 | -0.5 |
PixelOrientation.UPPER_RIGHT UPPER_RIGHT | +0.5 | -0.5 |
PixelOrientation.LOWER_LEFT LOWER_LEFT | -0.5 | +0.5 |
PixelOrientation.LOWER_RIGHT LOWER_RIGHT | +0.5 | +0.5 |
Parameters: orientation - The pixel orientation. The position relative to the pixel center. throws: IllegalArgumentException - if the specified orientation is not known. since: 2.4 |
inverseTransform | final Rectangle inverseTransform(Rectangle2D bounds)(Code) | | Returns the pixel coordinate of a rectangle containing the
specified geographic area. If the rectangle can't be computed,
then this method returns
null .
|
|
|