org.geotools.resources
Class LegacyGCSUtilities

java.lang.Object
  extended byorg.geotools.resources.LegacyGCSUtilities

Deprecated. Replaced by CoverageUtilities.

public final class LegacyGCSUtilities
extends java.lang.Object

A set of utilities methods for the Grid Coverage package. Those methods are not really rigorous; must of them should be seen as temporary implementations.

Version:
$Id: LegacyGCSUtilities.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Method Summary
static int getVisibleBand(java.awt.image.RenderedImage image)
          Deprecated. Returns the visible band in the specified image.
static boolean hasGridRange(GridGeometry geometry)
          Deprecated. Returns true if the specified geometry has a valid grid range.
static boolean hasTransform(GridGeometry geometry)
          Deprecated. Returns true if the specified geometry has a valid "grid to coordinate system" transform.
static boolean hasTransform(SampleDimension[] sampleDimensions)
          Deprecated. Returns true if at least one of the specified sample dimensions has a sample to geophysics transform which is not the identity transform.
static Envelope toEnvelope(GridRange gridRange)
          Deprecated. Cast the specified grid range into an envelope.
static GridRange toGridRange(Envelope envelope)
          Deprecated. Cast the specified envelope into a grid range.
static boolean uses(GridCoverage coverage, java.awt.image.RenderedImage image)
          Deprecated. Returns true if the specified grid coverage or any of its source uses the following image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasGridRange

public static boolean hasGridRange(GridGeometry geometry)
Deprecated. 
Returns true if the specified geometry has a valid grid range.


hasTransform

public static boolean hasTransform(GridGeometry geometry)
Deprecated. 
Returns true if the specified geometry has a valid "grid to coordinate system" transform.


toEnvelope

public static Envelope toEnvelope(GridRange gridRange)
Deprecated. 
Cast the specified grid range into an envelope. This is sometime used before to transform the envelope using CTSUtilities.transform(MathTransform, Envelope).


toGridRange

public static GridRange toGridRange(Envelope envelope)
Deprecated. 
Cast the specified envelope into a grid range. This is sometime used after the envelope has been transformed using CTSUtilities.transform(MathTransform, Envelope). The floating point values are rounded toward the nearest integer.

Note about conversion of floating point values to integers:
In previous versions, we used Math.floor(double) and Math.ceil(double) in order to make sure that the grid range encompass all the envelope (something similar to what Java2D does when casting Rectangle2D to Rectangle). But it had the undesirable effect of changing image width. For example the range [-0.25 99.75] were changed to [-1 100], which is not what the Affine operation expects for instance. Rounding to nearest integer produces better results. Note that the rounding mode do not alter the significiance of the "Resample" operation, since this operation will respect the "grid to coordinate system" transform no matter what the grid range is.


hasTransform

public static boolean hasTransform(SampleDimension[] sampleDimensions)
Deprecated. 
Returns true if at least one of the specified sample dimensions has a sample to geophysics transform which is not the identity transform.


uses

public static boolean uses(GridCoverage coverage,
                           java.awt.image.RenderedImage image)
Deprecated. 
Returns true if the specified grid coverage or any of its source uses the following image.


getVisibleBand

public static int getVisibleBand(java.awt.image.RenderedImage image)
Deprecated. 
Returns the visible band in the specified image. This method fetch the "GC_VisibleBand" property. If this property is undefined, then the visible band default to the first one.

Parameters:
image - The image for which to fetch the visible band.
Returns:
The visible band.


Copyright © GeoTools. All Rights Reserved.