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

org.deegree.model.coverage.grid
Class AbstractGridCoverageReader

java.lang.Object
  extended by org.deegree.model.coverage.grid.AbstractGridCoverageReader
All Implemented Interfaces:
GridCoverageReader
Direct Known Subclasses:
CompoundGridCoverageReader, GeoTIFFGridCoverageReader, ImageGridCoverageReader, OracleGeoRasterGridCoverageReader, RawDataReader

public abstract class AbstractGridCoverageReader
extends Object
implements GridCoverageReader

Version:
$Revision: 18195 $, $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Field Summary
protected  CoverageOffering description
           
protected  Envelope envelope
           
protected  Format format
           
protected  Object source
           
 
Constructor Summary
AbstractGridCoverageReader(Object source, CoverageOffering description, Envelope envelope, Format format)
           
 
Method Summary
protected  LonLatEnvelope calcLonLatEnvelope(Envelope env, String sourceCRS)
          transforms the passed Envelope to a LonLatEnvelope If the passed source CRS isn't equal to "EPSG:4326" the Envelope will be transformed to "EPSG:4326" first.
 String getCurrentSubname()
          Returns the name for the next grid coverage to be read from the input source.
 Format getFormat()
          Returns the format handled by this GridCoverageReader.
 String[] getMetadataNames()
          Returns the list of metadata keywords associated with the input source as a whole (not associated with any particular grid coverage).
 String getMetadataValue(String name)
          Retrieve the metadata value for a given metadata name.
 Object getSource()
          Returns the input source.
 String[] listSubNames()
          Retrieve the list of grid coverages contained within the input source.
 void setCurrentSubname(String name)
          Set the name for the next grid coverage to GridCoverageWriter#write within theinput.
 void setMetadataValue(String name, String value)
          Sets the metadata value for a given metadata name.
 
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.grid.GridCoverageReader
dispose, read
 

Field Detail

description

protected CoverageOffering description

source

protected Object source

envelope

protected Envelope envelope

format

protected Format format
Constructor Detail

AbstractGridCoverageReader

public AbstractGridCoverageReader(Object source,
                                  CoverageOffering description,
                                  Envelope envelope,
                                  Format format)
Parameters:
source -
description -
envelope -
format -
Method Detail

getSource

public Object getSource()
Returns the input source. This is the object passed to the "org.opengis.coverage.grid.GridCoverageExchange#getReader(Object)" method. It can be a String, an InputStream, a FileChannel, whatever.

Specified by:
getSource in interface GridCoverageReader
Returns:
the input source.

getMetadataNames

public String[] getMetadataNames()
                          throws IOException
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.

Specified by:
getMetadataNames in interface GridCoverageReader
Returns:
The list of metadata keywords for the input source.
Throws:
IOException - if an error occurs during reading.
revisit
This javadoc may not apply thats well in the iterator scheme.

getMetadataValue

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

Specified by:
getMetadataValue in interface GridCoverageReader
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:
IOException - if an error occurs during reading.
MetadataNameNotFoundException - if there is no value for the specified metadata name.
revisit
This javadoc may not apply thats well in the iterator scheme.

setMetadataValue

public void setMetadataValue(String name,
                             String value)
                      throws IOException,
                             MetadataNameNotFoundException
Sets the metadata value for a given metadata name.

Specified by:
setMetadataValue in interface GridCoverageReader
Parameters:
name - Metadata keyword for which to set the metadata.
value - The metadata value for the given metadata name.
Throws:
IOException - if an error occurs during writing.
MetadataNameNotFoundException - if the specified metadata name is not handled for this format.
revisit
This javadoc may not apply thats well in the iterator scheme.

setCurrentSubname

public void setCurrentSubname(String name)
                       throws IOException
Set the name for the next grid coverage to GridCoverageWriter#write within theinput. The subname can been fetch later at reading time.

Specified by:
setCurrentSubname in interface GridCoverageReader
Parameters:
name -
Throws:
IOException - if an error occurs during writing.
revisit
Do we need a special method for that, or should it be a metadata?

listSubNames

public String[] listSubNames()
                      throws IOException
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.

Specified by:
listSubNames in interface GridCoverageReader
Returns:
The list of grid coverages contained within the input source.
Throws:
IOException - if an error occurs during reading.
revisit
The javadoc should also be more explicit about hierarchical format. Should the names be returned as paths? Explain what to return if the GridCoverage are accessible by index only. A proposal is to name them "grid1", "grid2", etc.

getCurrentSubname

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

Specified by:
getCurrentSubname in interface GridCoverageReader
Returns:
the name for the next grid coverage to be read from the input source.
Throws:
IOException - if an error occurs during reading.
revisit
Do we need a special method for that, or should it be a metadata?

getFormat

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

Specified by:
getFormat in interface GridCoverageReader
Returns:
the format handled by this GridCoverageReader.

calcLonLatEnvelope

protected LonLatEnvelope calcLonLatEnvelope(Envelope env,
                                            String sourceCRS)
transforms the passed Envelope to a LonLatEnvelope If the passed source CRS isn't equal to "EPSG:4326" the Envelope will be transformed to "EPSG:4326" first.

Parameters:
env -
sourceCRS -
Returns:
LatLonEnvelope in "EPSG:4326"

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