org.geotoolkit.coverage
Interface CoverageStack.Element

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

public static interface CoverageStack.Element

Reference to a single n dimensional coverage in a (n+1) dimensional coverage stack. Each element is expected to extents over a range of z values in the dimension handled by the CoverageStack container.

Element implementations shall be able to provide their range of z-values without loading the coverage data. If an expensive loading is required, it should be delayed until the getCoverage(IIOListeners) method is invoked. If getCoverage is invoked more than once, caching (if desirable) is implementor's responsibility.

All methods declare IOException in their throws clause 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
Version:
3.00
Author:
Martin Desruisseaux (IRD)
Module:
coverage/geotk-coverage (download)    View source code for this class

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 information is mandatory.

Efficiency
This method shall not load a large amount of data, since it may be invoked soon. It is invoked just before getCoverage(IIOListeners) in order to log a "Loading data..." message.

Returns:
The coverage name.
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.

Performance note
This method shall not load a large amount of data, since it may be invoked soon. Note that this method may also be invoked often.

Returns:
The minimal and maximal values of coverage data.
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.

Performance note
This method shall not load a large amount of data, since it may be invoked soon.

Returns:
The coverage envelope, or null if this information is not available or is too costly to compute.
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.

Performance note
This method shall not load a large amount of data, since it may be invoked soon.

Returns:
The grid geometry, or null if this information is not available, not applicable or is too costly to compute.
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.

Performance note
This method shall not load a large amount of data, since it may be invoked soon.

Returns:
The sample dimensions, or null if this information is not available or is too costly to compute.
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 invoke the IIOListeners.addListenersTo(ImageReader) method if they use an image reader for loading data.

Performance note
The default CoverageStack implementation caches only the last coverages used. Consequently, more sophisticated coverage caching (if desired) is implementor responsibility.

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


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.