|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectGridCoverageStore
GridCoverageWriter
public abstract class GridCoverageWriter
Base class of GridCoverage writers. Writing is a two steps process:
setOutput(Object) method.write(GridCoverage, GridCoverageWriteParam) method.Example:
GridCoverage coverage = ...
GridCoverageWriter writer = ...
writer.setOutput(new File("MyCoverage.asc"));
writer.write(coverage, null);
Note: This class is conceptually equivalent to theImageWriterclass provided in the standard Java library. Implementations of this class are often wrappers around a JavaImageWriter, converting geodetic coordinates to pixel coordinates before to delegate the writing of pixel values.
ImageWriter
| coverage/geotk-coverageio (download) | View source code for this class |
| Field Summary |
|---|
| Fields inherited from class GridCoverageStore |
|---|
abortRequested |
| Constructor Summary | |
|---|---|
protected |
GridCoverageWriter()
Creates a new instance. |
| Method Summary | |
|---|---|
void |
dispose()
Allows any resources held by this writer to be released. |
Object |
getOutput()
Returns the output which was set by the last call to setOutput(Object),
or null if none. |
void |
reset()
Restores the GridCoverageWriter to its initial state. |
void |
setOutput(Object output)
Sets the output destination to the given object. |
abstract void |
write(GridCoverage coverage,
GridCoverageWriteParam param)
Writes a single grid coverage. |
void |
write(Iterable<? extends GridCoverage> coverages,
GridCoverageWriteParam param)
Writes one or many grid coverages. |
| Methods inherited from class GridCoverageStore |
|---|
abort, getLocale, getLogLevel, setLocale, setLogLevel |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected GridCoverageWriter()
| Method Detail |
|---|
public void setOutput(Object output)
throws CoverageStoreException
File or a String object. But some other types
(e.g. ImageOutputStream) may be accepted
as well depending on the implementation.
How streams are closed
GridCoverageWriter
from the given output object, then this coverage writer will close the stream when the
reset() or dispose() method is invoked, or when a new output is set.
output - The output (typically File or String) to be written.
IllegalArgumentException - If the output is not a valid instance for this writer.
CoverageStoreException - If the operation failed.ImageWriter.setOutput(Object)
public Object getOutput()
throws CoverageStoreException
setOutput(Object),
or null if none.
null if none.
CoverageStoreException - If the operation failed.ImageWriter.getOutput()
public abstract void write(GridCoverage coverage,
GridCoverageWriteParam param)
throws CoverageStoreException,
CancellationException
coverage - The coverage to write.param - Optional parameters used to control the writing process, or null.
IllegalStateException - If the output destination has not been set.
CoverageStoreException - If an error occurs while writing the information to the output destination.
CancellationException - If GridCoverageStore.abort() has been invoked in an other thread during
the execution of this method.
public void write(Iterable<? extends GridCoverage> coverages,
GridCoverageWriteParam param)
throws CoverageStoreException,
CancellationException
write(GridCoverage, GridCoverageWriteParam) if the given iterable
contains exactly one coverage, or throws an CoverageStoreException otherwise.
coverages - The coverages to write.param - Optional parameters used to control the writing process, or null.
IllegalStateException - If the output destination has not been set.
CoverageStoreException - If the iterable contains an unsupported number of coverages,
or if an error occurs while writing the information to the output destination.
CancellationException - If GridCoverageStore.abort() has been invoked in an other thread during
the execution of this method.
public void reset()
throws CoverageStoreException
GridCoverageWriter to its initial state.
reset in class GridCoverageStoreCoverageStoreException - If an error occurs while restoring to the initial state.ImageWriter.reset()
public void dispose()
throws CoverageStoreException
dispose in class GridCoverageStoreCoverageStoreException - If an error occurs while disposing resources.ImageWriter.dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||