org.geotools.gce.image
Class WorldImageWriter

java.lang.Object
  extended byorg.geotools.gce.image.WorldImageWriter
All Implemented Interfaces:
org.opengis.coverage.grid.GridCoverageWriter

public class WorldImageWriter
extends java.lang.Object
implements org.opengis.coverage.grid.GridCoverageWriter

Writes a GridCoverage to a raster image file and an accompanying world file. The destination specified must point to the location of the raster file to write to, as this is how the format is determined. The directory that file is located in must also already exist.

Author:
simone giannecchini, rgould, alessio fabiani

Constructor Summary
WorldImageWriter(java.lang.Object destination)
          Destination must be a File.
 
Method Summary
 void dispose()
          Cleans up the writer.
 java.lang.Object getDestination()
          (non-Javadoc)
 org.opengis.coverage.grid.Format getFormat()
          (non-Javadoc)
 java.lang.String[] getMetadataNames()
          (non-Javadoc)
 void setCurrentSubname(java.lang.String name)
          (non-Javadoc)
 void setMetadataValue(java.lang.String name, java.lang.String value)
          (non-Javadoc)
 void write(org.opengis.coverage.grid.GridCoverage coverage, org.opengis.parameter.GeneralParameterValue[] parameters)
          Takes a GridCoverage and writes the image to the destination file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorldImageWriter

public WorldImageWriter(java.lang.Object destination)
Destination must be a File. The directory it resides in must already exist. It must point to where the raster image is to be located. The world image will be derived from there.

Parameters:
destination -
Method Detail

getFormat

public org.opengis.coverage.grid.Format getFormat()
(non-Javadoc)

Specified by:
getFormat in interface org.opengis.coverage.grid.GridCoverageWriter
See Also:
GridCoverageWriter.getFormat()

getDestination

public java.lang.Object getDestination()
(non-Javadoc)

Specified by:
getDestination in interface org.opengis.coverage.grid.GridCoverageWriter
See Also:
GridCoverageWriter.getDestination()

getMetadataNames

public java.lang.String[] getMetadataNames()
(non-Javadoc)

Specified by:
getMetadataNames in interface org.opengis.coverage.grid.GridCoverageWriter
See Also:
GridCoverageWriter.getMetadataNames()

setMetadataValue

public void setMetadataValue(java.lang.String name,
                             java.lang.String value)
                      throws java.io.IOException,
                             org.opengis.coverage.MetadataNameNotFoundException
(non-Javadoc)

Specified by:
setMetadataValue in interface org.opengis.coverage.grid.GridCoverageWriter
Throws:
java.io.IOException
org.opengis.coverage.MetadataNameNotFoundException
See Also:
GridCoverageWriter.setMetadataValue(java.lang.String, java.lang.String)

setCurrentSubname

public void setCurrentSubname(java.lang.String name)
                       throws java.io.IOException
(non-Javadoc)

Specified by:
setCurrentSubname in interface org.opengis.coverage.grid.GridCoverageWriter
Throws:
java.io.IOException
See Also:
GridCoverageWriter.setCurrentSubname(java.lang.String)

write

public void write(org.opengis.coverage.grid.GridCoverage coverage,
                  org.opengis.parameter.GeneralParameterValue[] parameters)
           throws java.lang.IllegalArgumentException,
                  java.io.IOException
Takes a GridCoverage and writes the image to the destination file. It then reads the format of the file and writes an accompanying world file. It will throw a FileFormatNotCompatibleWithGridCoverageException if Destination is not a File (URL is a read-only format!).

Specified by:
write in interface org.opengis.coverage.grid.GridCoverageWriter
Parameters:
coverage - the GridCoverage to write.
parameters - no parameters are accepted. Currently ignored.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
See Also:
org.opengis.coverage.grid.GridCoverageWriter#write(org.geotools.gc.GridCoverage, org.opengis.parameter.GeneralParameterValue[])

dispose

public void dispose()
             throws java.io.IOException
Cleans up the writer. Currently does nothing.

Specified by:
dispose in interface org.opengis.coverage.grid.GridCoverageWriter
Throws:
java.io.IOException - DOCUMENT ME!


Copyright © GeoTools. All Rights Reserved.