deegree 2.5 (2011/06/29 09:44 build-8-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 java.lang.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  java.lang.Object source
           
 
Constructor Summary
AbstractGridCoverageReader(java.lang.Object source, CoverageOffering description, Envelope envelope, Format format)
           
 
Method Summary
protected  LonLatEnvelope calcLonLatEnvelope(Envelope env, java.lang.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.
 java.lang.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.
 java.lang.String[] getMetadataNames()
          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)
          Retrieve the metadata value for a given metadata name.
 java.lang.Object getSource()
          Returns the input source.
 java.lang.String[] listSubNames()
          Retrieve the list of grid coverages contained within the input source.
 void setCurrentSubname(java.lang.String name)
          Set the name for the next grid coverage to GridCoverageWriter#write within theinput.
 void setMetadataValue(java.lang.String name, java.lang.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 java.lang.Object source

envelope

protected Envelope envelope

format

protected Format format
Constructor Detail

AbstractGridCoverageReader

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

getSource

public java.lang.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 java.lang.String[] getMetadataNames()
                                    throws java.io.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:
java.io.IOException - if an error occurs during reading.
revisit
This javadoc may not apply thats well in the iterator scheme.

getMetadataValue

public java.lang.String getMetadataValue(java.lang.String name)
                                  throws java.io.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:
java.io.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(java.lang.String name,
                             java.lang.String value)
                      throws java.io.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:
java.io.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(java.lang.String name)
                       throws java.io.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:
java.io.IOException - if an error occurs during writing.
revisit
Do we need a special method for that, or should it be a metadata?

listSubNames

public java.lang.String[] listSubNames()
                                throws java.io.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:
java.io.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 java.lang.String getCurrentSubname()
                                   throws java.io.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:
java.io.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,
                                            java.lang.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.5 (2011/06/29 09:44 build-8-official)

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