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

org.deegree.model.coverage.grid
Interface GridCoverageWriter

All Known Implementing Classes:
AbstractGridCoverageWriter, GeoTIFFGridCoverageWriter, GMLGridCoverageWriter, ImageGridCoverageWriter, XYZGridCoverageWriter

public interface GridCoverageWriter

Support for writing grid coverages into a persistent store. Instance of GridCoverageWriter are obtained through a call to GridCoverageExchange.getWriter(java.lang.Object, org.deegree.model.coverage.grid.Format). Grid coverages are usually added to the output stream in a sequential order.

Version:
$Revision: 20326 $, $Date: 2009-10-22 18:41:56 +0200 (Do, 22 Okt 2009) $
Author:
OpenGIS® consortium, last edited by: $Author: mschneider $
See Also:
GridCoverageExchange.getWriter(java.lang.Object, org.deegree.model.coverage.grid.Format), ImageWriter

Method Summary
 void dispose()
          Allows any resources held by this object to be released.
 java.lang.String getCurrentSubname()
          Returns the name for the next grid coverage to be write to 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 write within the output destination.
 void setMetadataValue(java.lang.String name, java.lang.String value)
          Sets the metadata value for a given metadata name.
 void write(GridCoverage coverage, GeneralParameterValueIm[] parameters)
          Writes the specified grid coverage.
 

Method Detail

getFormat

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

Returns:
the format handled by this GridCoverageWriter.

getDestination

java.lang.Object getDestination()
Returns the output destination. This is the object passed to the GridCoverageExchange.getWriter(java.lang.Object, org.deegree.model.coverage.grid.Format) method. It can be a String, an OutputStream, a FileChannel, etc.

Returns:
the output destination

getMetadataNames

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.

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

getMetadataValue

java.lang.Object getMetadataValue(java.lang.String name)
                                  throws java.io.IOException,
                                         MetadataNameNotFoundException
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.
MetadataNameNotFoundException - if there is no value for the specified metadata name.
revisit
This javadoc may not apply thats well in the iterator scheme.

setMetadataValue

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

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

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.

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

java.lang.String getCurrentSubname()
                                   throws java.io.IOException
Returns the name for the next grid coverage to be write to the output destination.

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

void setCurrentSubname(java.lang.String name)
                       throws java.io.IOException
Set the name for the next grid coverage to write within the output destination. The subname can been fetch later at reading time.

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?

write

void write(GridCoverage coverage,
           GeneralParameterValueIm[] parameters)
           throws InvalidParameterNameException,
                  InvalidParameterValueException,
                  ParameterNotFoundException,
                  java.io.IOException
Writes the specified grid coverage.

Parameters:
coverage - The grid coverage to write.
parameters - An optional set of parameters. Should be any or all of the parameters returned by Format.getWriteParameters().
Throws:
InvalidParameterNameException - if a parameter in parameters doesn't have a recognized name.
InvalidParameterValueException - if a parameter in parameters doesn't have a valid value.
ParameterNotFoundException - if a parameter was required for the operation but was not provided in the parameters list.
java.io.IOException - if the export failed for some other input/output reason, including IIOException if an error was thrown by the underlying image library.

dispose

void dispose()
             throws java.io.IOException
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 GridCoverageWriter. Otherwise, the writer may continue to hold on to resources indefinitely.

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

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