org.geotools.gc
Class GridGeometry

java.lang.Object
  extended byorg.geotools.gc.GridGeometry
All Implemented Interfaces:
Dimensioned, java.io.Serializable

Deprecated. Replaced by GeneralGridGeometry.

public class GridGeometry
extends java.lang.Object
implements Dimensioned, java.io.Serializable

Describes the valid range of grid coordinates and the math transform to transform grid coordinates to real world coordinates.

Version:
$Id: GridGeometry.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
OpenGIS, Martin Desruisseaux
See Also:
GC_GridGeometry, Serialized Form

Constructor Summary
GridGeometry(GridRange gridRange, Envelope userRange, boolean[] inverse)
          Deprecated. Construct a new grid geometry.
GridGeometry(GridRange gridRange, MathTransform gridToCoordinateSystem)
          Deprecated. Construct a new grid geometry from a math transform.
GridGeometry(java.awt.Rectangle gridRange, java.awt.geom.Rectangle2D userRange)
          Deprecated. Construct a new two-dimensional grid geometry.
 
Method Summary
 boolean equals(java.lang.Object object)
          Deprecated. Compares the specified object with this grid geometry for equality.
 int getDimension()
          Deprecated. Returns the number of dimensions.
 Envelope getEnvelope()
          Deprecated. Returns the bounding box of "real world" coordinates for this grid geometry.
 GridRange getGridRange()
          Deprecated. Returns the valid coordinate range of a grid coverage.
 MathTransform getGridToCoordinateSystem()
          Deprecated. Returns the math transform which allows for the transformations from grid coordinates to real world earth coordinates.
 MathTransform2D getGridToCoordinateSystem2D()
          Deprecated. Returns a math transform for the first two dimensions, if such a transform exists.
 int hashCode()
          Deprecated. Returns a hash value for this grid geometry.
 java.lang.String toString()
          Deprecated. Returns a string repr?sentation of this grid range.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridGeometry

public GridGeometry(GridRange gridRange,
                    MathTransform gridToCoordinateSystem)
Deprecated. 
Construct a new grid geometry from a math transform.

Parameters:
gridRange - The valid coordinate range of a grid coverage, or null if none. The lowest valid grid coordinate is zero for BufferedImage, but may be non-zero for arbitrary RenderedImage. A grid with 512 cells can have a minimum coordinate of 0 and maximum of 512, with 511 as the highest valid index.
gridToCoordinateSystem - The math transform which allows for the transformations from grid coordinates (pixel's center) to real world earth coordinates.
See Also:
RenderedImage.getMinX(), RenderedImage.getMinY(), RenderedImage.getWidth(), RenderedImage.getHeight()

GridGeometry

public GridGeometry(GridRange gridRange,
                    Envelope userRange,
                    boolean[] inverse)
Deprecated. 
Construct a new grid geometry. An affine transform will be computed automatically from the specified envelope. The inverse argument tells whatever or not an axis should be inversed. Callers will typically set inverse[1] to true in order to inverse the y axis.

Parameters:
gridRange - The valid coordinate range of a grid coverage.
userRange - The corresponding coordinate range in user coordinate. This rectangle must contains entirely all pixels, i.e. the rectangle's upper left corner must coincide with the upper left corner of the first pixel and the rectangle's lower right corner must coincide with the lower right corner of the last pixel.
inverse - Tells whatever or not inverse axis. A null value inverse no axis.

GridGeometry

public GridGeometry(java.awt.Rectangle gridRange,
                    java.awt.geom.Rectangle2D userRange)
Deprecated. 
Construct 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 and increasing y values goes down.
userRange - The corresponding coordinate range in user coordinate. Increasing x values goes right and increasing y values goes up. This rectangle must contains entirely all pixels, i.e. the rectangle's upper left corner must coincide with the upper left corner of the first pixel and the rectangle's lower right corner must coincide with the lower right corner of the last pixel.
Method Detail

getDimension

public int getDimension()
Deprecated. 
Returns the number of dimensions.

Specified by:
getDimension in interface Dimensioned

getEnvelope

public Envelope getEnvelope()
                     throws InvalidGridGeometryException
Deprecated. 
Returns the bounding box of "real world" coordinates for this grid geometry. This envelope is the grid range transformed to the "real world" coordinate system.

Returns:
The bounding box in "real world" coordinates.
Throws:
InvalidGridGeometryException - if the envelope can't be computed.
See Also:
getGridRange(), getGridToCoordinateSystem()

getGridRange

public GridRange getGridRange()
                       throws InvalidGridGeometryException
Deprecated. 
Returns the valid coordinate range of a grid coverage. The lowest valid grid coordinate is zero for BufferedImage, but may be non-zero for arbitrary RenderedImage. A grid with 512 cells can have a minimum coordinate of 0 and maximum of 512, with 511 as the highest valid index.

Returns:
The grid range (never null).
Throws:
InvalidGridGeometryException - if this grid geometry has no grid range.
See Also:
GC_GridGeometry.getGridRange(), RenderedImage.getMinX(), RenderedImage.getMinY(), RenderedImage.getWidth(), RenderedImage.getHeight()

getGridToCoordinateSystem

public MathTransform getGridToCoordinateSystem()
                                        throws InvalidGridGeometryException
Deprecated. 
Returns the math transform which allows for the transformations from grid coordinates to real world earth coordinates. The transform is often an affine transformation. The coordinate system of the real world coordinates is given by Coverage.getCoordinateSystem(). If no math transform is available, this method returns null.

Note: OpenGIS requires that the transform maps pixel centers to real world coordinates. This is different from some other systems that map pixel's upper left corner.

Returns:
The transform (never null).
Throws:
InvalidGridGeometryException - if this grid geometry has no transform.
See Also:
GC_GridGeometry.getGridToCoordinateSystem()

getGridToCoordinateSystem2D

public MathTransform2D getGridToCoordinateSystem2D()
                                            throws InvalidGridGeometryException
Deprecated. 
Returns a math transform for the first two dimensions, if such a transform exists. This is a convenient method for working on horizontal data while ignoring vertical or temporal dimensions. This method will succed only if the first two dimensions are separable from extra dimensions (i.e. the transformation from (x0x1x2...) to (y0y1y2...) must be such that y0 and y1 depend only on x0 and x1).

Returns:
The transform which allows for the transformations from grid coordinates to real world earth coordinates, operating only on the first two dimensions. The returned transform is often an instance of AffineTransform, which make it convenient for interoperability with Java2D.
Throws:
InvalidGridGeometryException - if a two-dimensional transform is not available for this grid geometry.

hashCode

public int hashCode()
Deprecated. 
Returns a hash value for this grid geometry. This value need not remain consistent between different implementations of the same class.


equals

public boolean equals(java.lang.Object object)
Deprecated. 
Compares the specified object with this grid geometry for equality.


toString

public java.lang.String toString()
Deprecated. 
Returns a string repr?sentation of this grid range. The returned string is implementation dependent. It is usually provided for debugging purposes.



Copyright © GeoTools. All Rights Reserved.