org.geotools.coverage
Interface CoverageStack.Element

All Known Implementing Classes:
CoverageStack.Adapter
Enclosing class:
CoverageStack

public static interface CoverageStack.Element

An element in a coverage stack. Each element is expected to extents over a range of z values (the new dimensions appended by the CoverageStack container). Implementations should be capable to returns coverage's range of z-values without loading the coverage's data. If an expensive loading is required, it should be delayed until the getCoverage(org.geotools.image.io.IIOListeners) method is invoked. If getCoverage is invoked more than once, caching (if desirable) is implementor's responsability.

All methods declares IOException in their throws cause in case I/O operations are required. Subclasses of IOException include IIOException for image I/O operations, or RemoteException for remote method invocations (which may be useful for large images database backed by a distant server).

Since:
2.1
Author:
Martin Desruisseaux

Method Summary
 Coverage getCoverage(IIOListeners listeners)
          Returns the coverage, loading the data if needed.
 Envelope getEnvelope()
          Returns the coverage envelope, or null if this information is too expensive to compute.
 GridGeometry getGridGeometry()
          The coverage grid geometry, or null if this information do not applies or is too expensive to compute.
 String getName()
          Returns a name for the coverage.
 SampleDimension[] getSampleDimensions()
          The sample dimension for the coverage, or null if this information is too expensive to compute.
 NumberRange getZRange()
          Returns the minimum and maximum z values for the coverage.
 

Method Detail

getName

String getName()
               throws IOException
Returns a name for the coverage. This method should not load a large amount of data, since it may be invoked soon. This method is invoked just before getCoverage(org.geotools.image.io.IIOListeners) in order to log a "Loading data..." message.

Throws:
IOException - if an I/O operation was required but failed.

getZRange

NumberRange getZRange()
                      throws IOException
Returns the minimum and maximum z values for the coverage. This information is mandatory. This method should not load a large amount of data, since it may be invoked soon. Note that this method may be invoked often, so it should be efficient.

Throws:
IOException - if an I/O operation was required but failed.

getEnvelope

Envelope getEnvelope()
                     throws IOException
Returns the coverage envelope, or null if this information is too expensive to compute. The envelope may or may not contains an extra dimension for the range of z values, since the CoverageStack class is tolerant in this regard. This method should not load a large amount of data, since it may be invoked soon.

Throws:
IOException - if an I/O operation was required but failed.

getGridGeometry

GridGeometry getGridGeometry()
                             throws IOException
The coverage grid geometry, or null if this information do not applies or is too expensive to compute. This method should not load a large amount of data, since it may be invoked soon.

Throws:
IOException - if an I/O operation was required but failed.

getSampleDimensions

SampleDimension[] getSampleDimensions()
                                      throws IOException
The sample dimension for the coverage, or null if this information is too expensive to compute. This method should not load a large amount of data, since it may be invoked soon.

Throws:
IOException - if an I/O operation was required but failed.

getCoverage

Coverage getCoverage(IIOListeners listeners)
                     throws IOException
Returns the coverage, loading the data if needed. Implementations should invokes the IIOListeners.addListenersTo(ImageReader) method if they use an image reader for loading data. Caching (if desired) is implementor's responsability. The default CoverageStack implementation caches only the last coverages used.

Parameters:
listeners - Listeners to register to the image I/O reader, if such a reader is going to be used.
Throws:
IOException - if a data loading was required but failed.


Copyright © 1996-2009 Geotools. All Rights Reserved.