deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.coverage
Class AbstractCoverage

java.lang.Object
  extended by org.deegree.model.coverage.AbstractCoverage
All Implemented Interfaces:
Serializable, Coverage
Direct Known Subclasses:
AbstractGridCoverage

public abstract class AbstractCoverage
extends Object
implements Coverage, Serializable

Provides access to an OpenGIS coverage. 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:

  1. A coverage may be represented by a set of polygons which exhaustively tile a plane (that is each point on the plane falls in precisely one polygon). The value returned by the coverage for a point is the value of an attribute of the polygon that contains the point.
  2. A coverage may be represented by a grid of values. The value returned by the coverage for a point is that of the grid value whose location is nearest the point.
  3. Coverage may be represented by a mathematical function. The value returned by the coverage for a point is just the return value of the function when supplied the coordinates of the point as arguments.
  4. Coverage may be represented by combination of these. For example, coverage may be represented by a combination of mathematical functions valid over a set of polynomials.
A coverage has a corresponding SampleDimension for each sample dimension in the coverage.

Version:
$Revision: 20326 $, $Date: 2009-10-22 18:41:56 +0200 (Do, 22. Okt 2009) $
Author:
Andreas Poth , last edited by: $Author: mschneider $
See Also:
Serialized Form

Field Summary
protected  CoverageOffering coverageOffering
           
protected  int numSources
           
protected  Coverage[] sources
           
 
Constructor Summary
AbstractCoverage(CoverageOffering coverageOffering, Envelope env)
           
AbstractCoverage(CoverageOffering coverageOffering, Envelope env, Coverage[] sources)
           
AbstractCoverage(CoverageOffering coverageOffering, Envelope env, Coverage[] sources, CoordinateSystem crs)
           
 
Method Summary
 CoordinateSystem getCoordinateReferenceSystem()
          Specifies the coordinate reference system used when accessing a coverage or grid coverage with the evaluate(...)
 CoverageOffering getCoverageOffering()
          returns the CoverageOffering describing a coverage
 String[] getDimensionNames()
          The names of each dimension in the coverage.
 Envelope getEnvelope()
          The bounding box for the coverage domain in coordinate reference system coordinates.
 String[] getMetadataNames()
          List of metadata keywords for a coverage.
 String getMetadataValue(String name)
          Retrieve the metadata value for a given metadata name.
 int getNumSources()
          Number of grid coverages which the grid coverage was derived from.
abstract  RenderableImage getRenderableImage(int xAxis, int yAxis)
          Returns 2D view of this coverage as a renderable image.
 SampleDimension getSampleDimension(int index)
          Retrieve sample dimension information for the coverage.
 Coverage getSource(int sourceDataIndex)
          Returns the source data for a coverage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.model.coverage.Coverage
getNumSampleDimensions
 

Field Detail

coverageOffering

protected CoverageOffering coverageOffering

numSources

protected int numSources

sources

protected Coverage[] sources
Constructor Detail

AbstractCoverage

public AbstractCoverage(CoverageOffering coverageOffering,
                        Envelope env)
Parameters:
coverageOffering -
env -

AbstractCoverage

public AbstractCoverage(CoverageOffering coverageOffering,
                        Envelope env,
                        Coverage[] sources)
Parameters:
coverageOffering -
env -
sources -

AbstractCoverage

public AbstractCoverage(CoverageOffering coverageOffering,
                        Envelope env,
                        Coverage[] sources,
                        CoordinateSystem crs)
Parameters:
coverageOffering -
env -
sources -
crs -
Method Detail

getCoordinateReferenceSystem

public CoordinateSystem getCoordinateReferenceSystem()
Specifies the coordinate reference system used when accessing a coverage or grid coverage with the evaluate(...) methods. It is also the coordinate reference system of the coordinates used with the math transform gridToCoordinateSystem}). This coordinate reference system is usually different than coordinate system of the grid. Grid coverage can be accessed (re-projected) with new coordinate reference system with the "org.opengis.coverage.processing.GridCoverageProcessor" component. In this case, a new instance of a grid coverage is created.

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

Specified by:
getCoordinateReferenceSystem in interface Coverage
Returns:
The coordinate reference system used when accessing a coverage or grid coverage with the evaluate(...) methods, or null.

getEnvelope

public Envelope getEnvelope()
The bounding box for the coverage domain in coordinate reference system coordinates. 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
 
If a grid coverage does not have any associated coordinate reference system, the minimum and maximum coordinate points for the envelope will be empty sequences.

Specified by:
getEnvelope in interface Coverage
Returns:
The bounding box for the coverage domain in coordinate system coordinates.

getDimensionNames

public String[] getDimensionNames()
The names of each dimension in the 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.

Specified by:
getDimensionNames in interface Coverage
Returns:
The names of each dimension in the coverage.

getSampleDimension

public SampleDimension getSampleDimension(int index)
                                   throws IndexOutOfBoundsException
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.

Specified by:
getSampleDimension in interface Coverage
Parameters:
index - Index for sample dimension to retrieve. Indices are numbered 0 to (n-1).
Returns:
Sample dimension information for the coverage, currently always null
Throws:
IndexOutOfBoundsException - if index is out of bounds.

getNumSources

public int getNumSources()
Number of grid coverages which the grid coverage was derived from. This implementation specification does not include interfaces for creating collections of coverages therefore this value will usually be one indicating an adapted grid coverage, or zero indicating a raw grid coverage.

Specified by:
getNumSources in interface Coverage
Returns:
The number of grid coverages which the grid coverage was derived from.

getSource

public Coverage getSource(int sourceDataIndex)
                   throws IndexOutOfBoundsException
Returns the source data for a coverage. This is intended to allow applications to establish what Coverages will be affected when others are updated, as well as to trace back to the "raw data".

Specified by:
getSource in interface Coverage
Parameters:
sourceDataIndex - Source coverage index. Indexes start at 0.
Returns:
The source data for a coverage.
Throws:
IndexOutOfBoundsException - if sourceDataIndex is out of bounds.
See Also:
getNumSources(), "org.opengis.coverage.grid.GridCoverage#getSource"

getMetadataNames

public String[] getMetadataNames()
List of metadata keywords for a coverage. If no metadata is available, the sequence will be empty.

Specified by:
getMetadataNames in interface Coverage
Returns:
the list of metadata keywords for a coverage.
See Also:
getMetadataValue(java.lang.String), PropertySource.getPropertyNames()

getMetadataValue

public String getMetadataValue(String name)
                        throws MetadataNameNotFoundException
Retrieve the metadata value for a given metadata name.

Specified by:
getMetadataValue in interface Coverage
Parameters:
name - Metadata keyword for which to retrieve data.
Returns:
the metadata value for a given metadata name.
Throws:
MetadataNameNotFoundException - if there is no value for the specified metadata name.
See Also:
getMetadataNames(), PropertySource.getProperty(java.lang.String)

getRenderableImage

public abstract RenderableImage getRenderableImage(int xAxis,
                                                   int yAxis)
                                            throws UnsupportedOperationException,
                                                   IndexOutOfBoundsException
Returns 2D view of this coverage as a renderable image. This optional operation allows interoperability with Java2D. If this coverage is a "org.opengis.coverage.grid.GridCoverage" backed by a RenderedImage, the underlying image can be obtained with: getRenderableImage(0,1).createDefaultRendering()

Specified by:
getRenderableImage in interface Coverage
Parameters:
xAxis - Dimension to use for the x axis.
yAxis - Dimension to use for the y axis.
Returns:
A 2D view of this coverage as a renderable image.
Throws:
UnsupportedOperationException - if this optional operation is not supported.
IndexOutOfBoundsException - if xAxis or yAxis is out of bounds.

getCoverageOffering

public CoverageOffering getCoverageOffering()
returns the CoverageOffering describing a coverage

Returns:
the CoverageOffering describing a coverage
See Also:
CoverageOffering

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org