deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.model.coverage.grid
Class AbstractGridCoverageWriter

java.lang.Object
  extended by org.deegree.model.coverage.grid.AbstractGridCoverageWriter
All Implemented Interfaces:
GridCoverageWriter
Direct Known Subclasses:
GeoTIFFGridCoverageWriter, GMLGridCoverageWriter, ImageGridCoverageWriter, XYZGridCoverageWriter

public abstract class AbstractGridCoverageWriter
extends java.lang.Object
implements GridCoverageWriter

Since:
2.0
Version:
$Revision: 18195 $, 1.0. $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  java.lang.Object destination
           
protected  Format format
           
protected  java.util.Map<java.lang.String,java.lang.Object> metadata
           
 
Constructor Summary
AbstractGridCoverageWriter(java.lang.Object destination, java.util.Map<java.lang.String,java.lang.Object> metadata, java.lang.String[] subNames, java.lang.String currentSubname, Format format)
           
 
Method Summary
 java.lang.String getCurrentSubname()
          Returns the name for the next grid coverage to be read from the output destination.
 java.lang.Object getDestination()
          Returns the output destination.
 Format getFormat()
          Returns the format handled by this GridCoverageWriter.
 java.lang.String[] getMetadataNames()
          Returns the list of metadata keywords associated with the output destination as a whole (not associated with any particular grid coverage).
 java.lang.Object getMetadataValue(java.lang.String name)
          Retrieve the metadata value for a given metadata name.
 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(GridCoverage, GeneralParameterValue[]) within theoutput destination.
 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.GridCoverageWriter
dispose, write
 

Field Detail

destination

protected java.lang.Object destination

metadata

protected java.util.Map<java.lang.String,java.lang.Object> metadata

format

protected Format format
Constructor Detail

AbstractGridCoverageWriter

public AbstractGridCoverageWriter(java.lang.Object destination,
                                  java.util.Map<java.lang.String,java.lang.Object> metadata,
                                  java.lang.String[] subNames,
                                  java.lang.String currentSubname,
                                  Format format)
Parameters:
destination -
metadata -
subNames -
currentSubname -
format -
Method Detail

getFormat

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

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

getDestination

public java.lang.Object getDestination()
Returns the output destination. This is the object passed to the !unknown! method. It can be a String, an OutputStream, a FileChannel, etc.

Specified by:
getDestination in interface GridCoverageWriter
Returns:
the output destination

getMetadataNames

public java.lang.String[] getMetadataNames()
Returns the list of metadata keywords associated with the output destination as a whole (not associated with any particular grid coverage). If no metadata is allowed, the array will be empty.

Specified by:
getMetadataNames in interface GridCoverageWriter
Returns:
The list of metadata keywords for the output destination.
revisit
This javadoc may not apply thats well in the iterator scheme.

getMetadataValue

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

Specified by:
getMetadataValue in interface GridCoverageWriter
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 GridCoverageWriter
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.

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 GridCoverageWriter
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 output destination.

Specified by:
getCurrentSubname in interface GridCoverageWriter
Returns:
the name for the next grid coverage to be
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?

setCurrentSubname

public void setCurrentSubname(java.lang.String name)
                       throws java.io.IOException
Set the name for the next grid coverage to GridCoverageWriter.write(GridCoverage, GeneralParameterValue[]) within theoutput destination. The subname can been fetch later at reading time.

Specified by:
setCurrentSubname in interface GridCoverageWriter
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?

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