|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.coverage.grid.GeneralGridGeometry org.geotools.coverage.grid.GridGeometry2D
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 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 , because a three-dimensional coordinate is mandatory for referencing a pixel without ambiguity.
Field Summary | |
int |
axisDimensionX
The ( gridDimensionX , gridDimensionY ) dimensions in the envelope space.
|
int |
axisDimensionY
The ( gridDimensionX , gridDimensionY ) dimensions in the envelope space.
|
int |
gridDimensionX
The first () and second () dimensions of grid range with length greater than 1. |
int |
gridDimensionY
The first () and second () dimensions of grid range with length greater than 1. |
Fields inherited from class org.geotools.coverage.grid.GeneralGridGeometry |
CRS, ENVELOPE, GRID_RANGE, GRID_TO_CRS, gridRange, gridToCRS |
Constructor Summary | |
GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange,
org.opengis.spatialschema.geometry.Envelope userRange)
Constructs a new grid geometry from an envelope. |
|
GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange,
org.opengis.spatialschema.geometry.Envelope userRange,
boolean[] reverse)
Deprecated. Replaced by . Users just need to append the argument value, so this constructor will be removed in a future version in order to keep the API lighter. |
|
GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange,
org.opengis.spatialschema.geometry.Envelope userRange,
boolean[] reverse,
boolean swapXY)
Constructs a new grid geometry from an envelope. |
|
GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange,
org.opengis.referencing.operation.MathTransform gridToCRS)
Deprecated. Replaced by GridGeometry2D(gridRange, gridToCRS, null) . |
|
GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange,
org.opengis.referencing.operation.MathTransform gridToCRS,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Constructs a new grid geometry from a math transform. |
|
GridGeometry2D(java.awt.Rectangle gridRange,
java.awt.geom.Rectangle2D userRange)
Constructs a new two-dimensional grid geometry. |
Method Summary | |
boolean |
equals(java.lang.Object object)
Compares the specified object with this grid geometry for equality. |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem2D()
Returns the two-dimensional part of this grid geometry CRS. |
Envelope2D |
getEnvelope2D()
Returns the two-dimensional bounding box for the coverage domain in coordinate reference system coordinates. |
java.awt.Rectangle |
getGridRange2D()
Returns the two-dimensional part of the grid range as a rectangle. |
org.opengis.referencing.operation.MathTransform2D |
getGridToCoordinateSystem2D()
Returns a math transform for the two dimensional part. |
Methods inherited from class org.geotools.coverage.grid.GeneralGridGeometry |
getCoordinateReferenceSystem, getDimension, getEnvelope, getGridRange, getGridToCoordinateSystem, hashCode, isDefined, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public final int gridDimensionX
public final int gridDimensionY
public final int axisDimensionX
gridDimensionX
, gridDimensionY
) dimensions in the envelope space.
They are the (x, y) dimensions after the
grid to CRS transform.
Those dimensions are usually 0 and 1 respectively.
public final int axisDimensionY
gridDimensionX
, gridDimensionY
) dimensions in the envelope space.
They are the (x, y) dimensions after the
grid to CRS transform.
Those dimensions are usually 0 and 1 respectively.
Constructor Detail |
public GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange, org.opengis.referencing.operation.MathTransform gridToCRS) throws java.lang.IllegalArgumentException
GridGeometry2D(gridRange, gridToCRS, null)
.
public GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange, org.opengis.referencing.operation.MathTransform gridToCRS, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws java.lang.IllegalArgumentException, org.opengis.spatialschema.geometry.MismatchedDimensionException
gridRange
- The valid coordinate range of a grid coverage, or 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.gridToCRS
- The math transform which allows for the transformations
from grid coordinates (pixel's center) to real world earth coordinates.crs
- The coordinate reference system for the "real world" coordinates, or
if unknown. This CRS is given to the envelope.
org.opengis.spatialschema.geometry.MismatchedDimensionException
- if the math transform and the CRS doesn't have
consistent dimensions.
java.lang.IllegalArgumentException
- if has more than 2 dimensions with
a length larger than 1, or if the math transform
can't transform coordinates in the domain of the specified grid range.RenderedImage.getMinX()
,
RenderedImage.getMinY()
,
RenderedImage.getWidth()
,
RenderedImage.getHeight()
public GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange, org.opengis.spatialschema.geometry.Envelope userRange) throws java.lang.IllegalArgumentException, org.opengis.spatialschema.geometry.MismatchedDimensionException
gridRange
- The valid coordinate range of a grid coverage.userRange
- The corresponding coordinate range in user coordinate.
java.lang.IllegalArgumentException
- if has more than 2 dimensions with
a length larger than 1.
org.opengis.spatialschema.geometry.MismatchedDimensionException
- if the grid range and the CRS doesn't have
consistent dimensions.public GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange, org.opengis.spatialschema.geometry.Envelope userRange, boolean[] reverse) throws java.lang.IllegalArgumentException, org.opengis.spatialschema.geometry.MismatchedDimensionException
public GridGeometry2D(org.opengis.coverage.grid.GridRange gridRange, org.opengis.spatialschema.geometry.Envelope userRange, boolean[] reverse, boolean swapXY) throws java.lang.IllegalArgumentException, org.opengis.spatialschema.geometry.MismatchedDimensionException
gridRange
- The valid coordinate range of a grid coverage.userRange
- The corresponding coordinate range in user coordinate.reverse
- Tells for each axis in user space whatever or not its
direction should be reversed. A value reverse no axis.swapXY
- If , then the two first axis will be interchanged.
java.lang.IllegalArgumentException
- if has more than 2 dimensions with
a length larger than 1.
org.opengis.spatialschema.geometry.MismatchedDimensionException
- if the grid range and the CRS doesn't have
consistent dimensions.public GridGeometry2D(java.awt.Rectangle gridRange, java.awt.geom.Rectangle2D userRange)
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 |
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem2D() throws InvalidGridGeometryException
InvalidGridGeometryException
- if this grid geometry has no CRS (i.e.
isDefined(CRS)
returned ).GeneralGridGeometry.getCoordinateReferenceSystem()
public Envelope2D getEnvelope2D() throws InvalidGridGeometryException
InvalidGridGeometryException
- if this grid geometry has no envelope (i.e.
isDefined(ENVELOPE)
returned ).GeneralGridGeometry.getEnvelope()
public java.awt.Rectangle getGridRange2D() throws InvalidGridGeometryException
InvalidGridGeometryException
- if this grid geometry has no grid range (i.e.
isDefined(GRID_RANGE)
returned ).GeneralGridGeometry.getGridRange()
,
RenderedImage.getMinX()
,
RenderedImage.getMinY()
,
RenderedImage.getWidth()
,
RenderedImage.getHeight()
public org.opengis.referencing.operation.MathTransform2D getGridToCoordinateSystem2D() throws InvalidGridGeometryException
AffineTransform
, which
make it convenient for interoperability with Java2D.
InvalidGridGeometryException
- if a two-dimensional transform is not available
for this grid geometry.GeneralGridGeometry.getGridToCoordinateSystem()
public boolean equals(java.lang.Object object)
equals
in class GeneralGridGeometry
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |