org.geotools.cv
Class Coverage

java.lang.Object
  extended byjavax.media.jai.PropertySourceImpl
      extended byorg.geotools.cv.Coverage
All Implemented Interfaces:
Dimensioned, javax.media.jai.PropertySource, java.io.Serializable
Direct Known Subclasses:
GridCoverage

Deprecated. Replaced by org.geotools.coverage.Coverage in the org.geotools.coverage package.

public abstract class Coverage
extends javax.media.jai.PropertySourceImpl
implements Dimensioned

Base class of all coverage type. The essential property of coverage is to be able to generate a value for any point within its domain. How coverage is represented internally is not a concern. For example consider the following different internal representations of coverage:

Grid coverages are typically 2D while other coverages may be 3D or 4D. The dimension of grid coverage may be queried in many ways: All those methods should returns the same number. Note that the dimension of grid coverage is not the same than the number of sample dimensions (getSampleDimensions().length). The later may be better understood as the number of bands for 2D grid coverage. A coverage has a corresponding SampleDimension for each sample dimension in the coverage.

There is no getMetadataValue(...) method in this implementation. OpenGIS's metadata are called "Properties" in Java Advanced Imaging. Use PropertySourceImpl.getProperty(java.lang.String) instead.

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

Nested Class Summary
protected  class Coverage.Export
          Deprecated. Export a Geotools Coverage as an OpenGIS CV_Coverage object.
protected  class Coverage.Renderable
          Deprecated. Base class for renderable image view of a coverage.
 
Field Summary
protected  CoordinateSystem coordinateSystem
          Deprecated. The coordinate system, or null if there is none.
 
Fields inherited from class javax.media.jai.PropertySourceImpl
cachedPropertyNames, properties, propertySources
 
Constructor Summary
protected Coverage(Coverage coverage)
          Deprecated. Construct a new coverage with the same parameters than the specified coverage.
protected Coverage(java.lang.String name, CoordinateSystem coordinateSystem, javax.media.jai.PropertySource source, java.util.Map properties)
          Deprecated. Construct a coverage using the specified coordinate system.
 
Method Summary
 void dispose()
          Deprecated. Provides a hint that a coverage will no longer be accessed from a reference in user space.
 boolean[] evaluate(CoordinatePoint coord, boolean[] dest)
          Deprecated. Returns a sequence of boolean values for a given point in the coverage.
 byte[] evaluate(CoordinatePoint coord, byte[] dest)
          Deprecated. Returns a sequence of byte values for a given point in the coverage.
abstract  double[] evaluate(CoordinatePoint coord, double[] dest)
          Deprecated. Returns a sequence of double values for a given point in the coverage.
 float[] evaluate(CoordinatePoint coord, float[] dest)
          Deprecated. Returns a sequence of float values for a given point in the coverage.
 int[] evaluate(CoordinatePoint coord, int[] dest)
          Deprecated. Returns a sequence of integer values for a given point in the coverage.
 CoordinateSystem getCoordinateSystem()
          Deprecated. Returns the coordinate system.
 int getDimension()
          Deprecated. Returns the dimension of the grid coverage.
 java.lang.String[] getDimensionNames(java.util.Locale locale)
          Deprecated. Returns the names of each dimension in this coverage.
 Envelope getEnvelope()
          Deprecated. Returns The bounding box for the coverage domain in coordinate system coordinates.
 java.lang.String getName(java.util.Locale locale)
          Deprecated. Returns the coverage name, localized for the supplied locale.
 java.awt.image.renderable.RenderableImage getRenderableImage(int xAxis, int yAxis)
          Deprecated. Returns 2D view of this grid coverage as a renderable image.
abstract  SampleDimension[] getSampleDimensions()
          Deprecated. Retrieve sample dimension information for the coverage.
 java.lang.String toString()
          Deprecated. Returns a string repr?sentation of this coverage.
 
Methods inherited from class javax.media.jai.PropertySourceImpl
getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

coordinateSystem

protected final CoordinateSystem coordinateSystem
Deprecated. 
The coordinate system, or null if there is none.

Constructor Detail

Coverage

protected Coverage(java.lang.String name,
                   CoordinateSystem coordinateSystem,
                   javax.media.jai.PropertySource source,
                   java.util.Map properties)
Deprecated. 
Construct a coverage using the specified coordinate system. If the coordinate system is null, then the subclasses must override getDimension().

Parameters:
name - The coverage name.
coordinateSystem - The coordinate system. This specifies the coordinate system used when accessing a coverage or grid coverage with the evaluate(...) methods.
source - The source for this coverage, or null if none. Source may be (but is not limited to) a PlanarImage or an other Coverage object.
properties - The set of properties for this coverage, or null if there is none. "Properties" in Java Advanced Imaging is what OpenGIS calls "Metadata". There is no getMetadataValue(...) method in this implementation. Use PropertySourceImpl.getProperty(java.lang.String) instead. Keys may be String or CaselessStringKey objects, while values may be any Object.

Coverage

protected Coverage(Coverage coverage)
Deprecated. 
Construct a new coverage with the same parameters than the specified coverage.

Method Detail

getName

public java.lang.String getName(java.util.Locale locale)
Deprecated. 
Returns the coverage name, localized for the supplied locale. If the specified locale is not available, returns a name in an arbitrary locale. The default implementation returns the name specified at construction time.

Parameters:
locale - The desired locale, or null for a default locale.
Returns:
The coverage name in the specified locale, or in an arbitrary locale if the specified localization is not available.

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
Deprecated. 
Returns the coordinate system. This specifies the coordinate system used when accessing a coverage or grid coverage with the evaluate(...) methods. It is also the coordinate system of the coordinates used with the math transform GridGeometry.getGridToCoordinateSystem(). This coordinate system is usually different than the grid coordinate system of the grid. A grid coverage can be accessed (re-projected) with new coordinate system with the GridCoverageProcessor component. In this case, a new instance of a grid coverage is created.

Note: If a coverage does not have an associated coordinate system, the returned value will be null. The GridGeometry.gridToCoordinateSystem) attribute should also be null if the coordinate system is null.

Returns:
The coordinate system, or null if this coverage does not have an associated coordinate system.
See Also:
CV_Coverage.getCoordinateSystem(), GridGeometry.getGridToCoordinateSystem()

getEnvelope

public Envelope getEnvelope()
Deprecated. 
Returns The bounding box for the coverage domain in coordinate system coordinates. May be null if this coverage has no associated coordinate system. For grid coverages, the grid cells are centered on each grid coordinate. The envelope for a 2-D grid coverage includes the following corner positions.
 (Minimum row - 0.5, Minimum column - 0.5) for the minimum coordinates
 (Maximum row - 0.5, Maximum column - 0.5) for the maximum coordinates
 
The default implementation returns the coordinate system envelope if there is one.

Returns:
The bounding box for the coverage domain in coordinate system coordinates.
See Also:
CV_Coverage.getEnvelope()

getDimension

public int getDimension()
Deprecated. 
Returns the dimension of the grid coverage. The default implementation returns the dimension of the underlying CoordinateSystem.

Specified by:
getDimension in interface Dimensioned
Returns:
The number of dimensions of this coverage.

getDimensionNames

public java.lang.String[] getDimensionNames(java.util.Locale locale)
Deprecated. 
Returns the names of each dimension in this coverage. Typically these names are "x", "y", "z" and "t". The number of items in the sequence is the number of dimensions in the coverage. Grid coverages are typically 2D (x, y) while other coverages may be 3D (x, y, z) or 4D (x, y, z, t). The number of dimensions of the coverage is the number of entries in the list of dimension names. The default implementation ask for CoordinateSystem axis names, or returns "x", "y"... if this coverage has no coordinate system.

Parameters:
locale - The desired locale, or null for the default locale.
Returns:
The names of each dimension. The array's length is equals to getDimension().
See Also:
CV_Coverage.getDimensionNames()

getSampleDimensions

public abstract SampleDimension[] getSampleDimensions()
Deprecated. 
Retrieve sample dimension information for the coverage. For a grid coverage, a sample dimension is a band. The sample dimension information include such things as description, data type of the value (bit, byte, integer...), the no data values, minimum and maximum values and a color table if one is associated with the dimension. A coverage must have at least one sample dimension.

Returns:
Sample dimension information for the coverage.
See Also:
CV_Coverage.getNumSampleDimensions(), CV_Coverage.getSampleDimension(int)

evaluate

public boolean[] evaluate(CoordinatePoint coord,
                          boolean[] dest)
                   throws org.opengis.coverage.CannotEvaluateException
Deprecated. 
Returns a sequence of boolean values for a given point in the coverage. A value for each sample dimension is included in the sequence. The default interpolation type used when accessing grid values for points which fall between grid cells is nearest neighbor. The coordinate system of the point is the same as the grid coverage coordinate system.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null to create a new array. If non-null, this array must be at least getSampleDimensions().length long.
Returns:
The dest array, or a newly created array if dest was null.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.
See Also:
CV_Coverage.evaluateAsBoolean(org.opengis.pt.PT_CoordinatePoint)

evaluate

public byte[] evaluate(CoordinatePoint coord,
                       byte[] dest)
                throws org.opengis.coverage.CannotEvaluateException
Deprecated. 
Returns a sequence of byte values for a given point in the coverage. A value for each sample dimension is included in the sequence. The default interpolation type used when accessing grid values for points which fall between grid cells is nearest neighbor. The coordinate system of the point is the same as the coverage coordinate system.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null to create a new array. If non-null, this array must be at least getSampleDimensions().length long.
Returns:
The dest array, or a newly created array if dest was null.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.
See Also:
CV_Coverage.evaluateAsInteger(org.opengis.pt.PT_CoordinatePoint)

evaluate

public int[] evaluate(CoordinatePoint coord,
                      int[] dest)
               throws org.opengis.coverage.CannotEvaluateException
Deprecated. 
Returns a sequence of integer values for a given point in the coverage. A value for each sample dimension is included in the sequence. The default interpolation type used when accessing grid values for points which fall between grid cells is nearest neighbor. The coordinate system of the point is the same as the coverage coordinate system.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null to create a new array. If non-null, this array must be at least getSampleDimensions().length long.
Returns:
The dest array, or a newly created array if dest was null.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.
See Also:
CV_Coverage.evaluateAsInteger(org.opengis.pt.PT_CoordinatePoint)

evaluate

public float[] evaluate(CoordinatePoint coord,
                        float[] dest)
                 throws org.opengis.coverage.CannotEvaluateException
Deprecated. 
Returns a sequence of float values for a given point in the coverage. A value for each sample dimension is included in the sequence. The default interpolation type used when accessing grid values for points which fall between grid cells is nearest neighbor. The coordinate system of the point is the same as the coverage coordinate system.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null to create a new array. If non-null, this array must be at least getSampleDimensions().length long.
Returns:
The dest array, or a newly created array if dest was null.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public abstract double[] evaluate(CoordinatePoint coord,
                                  double[] dest)
                           throws org.opengis.coverage.CannotEvaluateException
Deprecated. 
Returns a sequence of double values for a given point in the coverage. A value for each sample dimension is included in the sequence. The default interpolation type used when accessing grid values for points which fall between grid cells is nearest neighbor. The coordinate system of the point is the same as the grid coverage coordinate system.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null to create a new array. If non-null, this array must be at least getSampleDimensions().length long.
Returns:
The dest array, or a newly created array if dest was null.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.
See Also:
CV_Coverage.evaluateAsDouble(org.opengis.pt.PT_CoordinatePoint)

getRenderableImage

public java.awt.image.renderable.RenderableImage getRenderableImage(int xAxis,
                                                                    int yAxis)
Deprecated. 
Returns 2D view of this grid coverage as a renderable image. This method allows interoperability with Java2D.

Parameters:
xAxis - Dimension to use for x axis.
yAxis - Dimension to use for y axis.
Returns:
A 2D view of this grid coverage as a renderable image.

dispose

public void dispose()
Deprecated. 
Provides a hint that a coverage will no longer be accessed from a reference in user space. The results are equivalent to those that occur when the program loses its last reference to this coverage, the garbage collector discovers this, and finalize is called. This can be used as a hint in situations where waiting for garbage collection would be overly conservative. The results of referencing a coverage after a call to dispose() are undefined.

See Also:
PlanarImage.dispose()

toString

public java.lang.String toString()
Deprecated. 
Returns a string repr?sentation of this coverage. This string is for debugging purpose only and may change in future version.



Copyright © GeoTools. All Rights Reserved.