org.geotools.data.coverage.grid
Interface GridCoverageReader


Deprecated. You should use the interfaces provided by GeoApi package

public interface GridCoverageReader

Support for reading grid coverages out of a persisten store. Instance of GridCoverageReader are obtained through a call to GridCoverageExchange.getReader(java.lang.Object). Grid coverages are usually read from the input stream in a sequential order.

Version:
2.0
Author:
OpenGIS® consortium
See Also:
GridCoverageExchange.getReader(java.lang.Object), ImageReader

Method Summary
 void dispose()
          Deprecated. Allows any resources held by this object to be released.
 java.lang.String getCurrentSubname()
          Deprecated. Returns the name for the next grid coverage to be read from the input source.
 Format getFormat()
          Deprecated. Returns the format handled by this GridCoverageReader.
 java.lang.String[] getMetadataNames()
          Deprecated. Returns the list of metadata keywords associated with the input source as a whole (not associated with any particular grid coverage).
 java.lang.String getMetadataValue(java.lang.String name)
          Deprecated. Retrieve the metadata value for a given metadata name.
 java.lang.Object getSource()
          Deprecated. Returns the input source.
 boolean hasMoreGridCoverages()
          Deprecated. Returns true if there is at least one more grid coverage available on the stream.
 java.lang.String[] listSubNames()
          Deprecated. Retrieve the list of grid coverages contained within the input source.
 org.opengis.coverage.grid.GridCoverage read(org.opengis.parameter.ParameterValueGroup parameters)
          Deprecated. Read the grid coverage from the current stream position, and move to the next grid coverage.
 void skip()
          Deprecated. Skip the current grid coverage without reading it, and move the stream position to the next grid coverage.
 

Method Detail

getFormat

public Format getFormat()
Deprecated. 
Returns the format handled by this GridCoverageReader.


getSource

public java.lang.Object getSource()
Deprecated. 
Returns the input source. This is the object passed to the GridCoverageExchange.getReader(java.lang.Object) method. It can be a String, an InputStream, a FileChannel, whatever.


getMetadataNames

public java.lang.String[] getMetadataNames()
                                    throws java.io.IOException
Deprecated. 
Returns the list of metadata keywords associated with the input source as a whole (not associated with any particular grid coverage). If no metadata is available, the array will be empty.

Returns:
The list of metadata keywords for the input source.
Throws:
java.io.IOException - if an error occurs during reading.

getMetadataValue

public java.lang.String getMetadataValue(java.lang.String name)
                                  throws java.io.IOException,
                                         org.opengis.coverage.MetadataNameNotFoundException
Deprecated. 
Retrieve the metadata value for a given metadata name.

Parameters:
name - Metadata keyword for which to retrieve metadata.
Returns:
The metadata value for the given metadata name. Should be one of the name returned by getMetadataNames().
Throws:
java.io.IOException - if an error occurs during reading.
org.opengis.coverage.MetadataNameNotFoundException - if there is no value for the specified metadata name.

listSubNames

public java.lang.String[] listSubNames()
                                throws java.io.IOException
Deprecated. 
Retrieve the list of grid coverages contained within the input source. Each grid can have a different coordinate system, number of dimensions and grid geometry. For example, a HDF-EOS file (GRID.HDF) contains 6 grid coverages each having a different projection. An empty array will be returned if no sub names exist.

Returns:
The list of grid coverages contained within the input source.
Throws:
java.io.IOException - if an error occurs during reading.

getCurrentSubname

public java.lang.String getCurrentSubname()
                                   throws java.io.IOException
Deprecated. 
Returns the name for the next grid coverage to be read from the input source.

Throws:
java.io.IOException - if an error occurs during reading.

hasMoreGridCoverages

public boolean hasMoreGridCoverages()
                             throws java.io.IOException
Deprecated. 
Returns true if there is at least one more grid coverage available on the stream.

Throws:
java.io.IOException

read

public org.opengis.coverage.grid.GridCoverage read(org.opengis.parameter.ParameterValueGroup parameters)
                                            throws java.lang.IllegalArgumentException,
                                                   java.io.IOException
Deprecated. 
Read the grid coverage from the current stream position, and move to the next grid coverage. The method hasMoreGridCoverages() should be invoked first in order to verify that a coverage is available.

Parameters:
parameters - Set of parameters generated by the Format.getReadParameters() parameter descriptor.
Returns:
A new grid coverage from the input source.
Throws:
org.opengis.parameter.InvalidParameterNameException - if a parameter in parameters doesn't have a recognized name.
org.opengis.parameter.InvalidParameterValueException - if a parameter in parameters doesn't have a valid value.
org.opengis.parameter.ParameterNotFoundException - if a parameter was required for the operation but was not provided in the parameters list.
org.opengis.coverage.grid.CannotCreateGridCoverageException - if the coverage can't be created for a logical reason (for example an unsupported format, or an inconsistency found in the data).
java.io.IOException - if a read operation failed for some other input/output reason, including FileNotFoundException if no file with the given name can be found, or IIOException if an error was thrown by the underlying image library.
java.lang.IllegalArgumentException

skip

public void skip()
          throws java.io.IOException
Deprecated. 
Skip the current grid coverage without reading it, and move the stream position to the next grid coverage.

Throws:
java.io.IOException - if the operation failed.

dispose

public void dispose()
             throws java.io.IOException
Deprecated. 
Allows any resources held by this object to be released. The result of calling any other method subsequent to a call to this method is undefined. It is important for applications to call this method when they know they will no longer be using this GridCoverageReader. Otherwise, the reader may continue to hold on to resources indefinitely.

Throws:
java.io.IOException - if an error occured while disposing resources (for example while closing a file).


Copyright © GeoTools. All Rights Reserved.