|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectStatic
CoverageIO
public final class CoverageIO
Convenience methods for reading or writing a coverage. The method in this class creates
instances of GridCoverageReader or GridCoverageWriter for performing the
actual work. This is similar to the standard ImageIO class and the
XImageIO class, but applied to coverages.
Readers
In the simplest case, this class just creates an ImageCoverageReader instance with
the input set to the given object (typically a File or URL). However if the
image is very large and is not encoded in a format that support natively tiling, it may be
more efficient to create a mosaic of tiles first. The writeOrReuseMosaic(File)
method is provided for this purpose.
Writers
This class delegates the actual work to the ImageCoverageWriter class.
| coverage/geotk-coverageio (download) | View source code for this class |
| Method Summary | |
|---|---|
static GridCoverageReader |
createMosaicReader(Object input,
CoordinateReferenceSystem crs)
Creates a mosaic reader using the given tiles, which must exist. |
static GridCoverageReader |
createSimpleReader(Object input)
Creates a simple reader which does not use any pyramid or mosaic tiling. |
static GridCoverageWriter |
createSimpleWriter(Object output)
Creates a simple writer which does not perform any pyramid or mosaic tiling. |
static GridCoverage |
read(Object input)
Convenience method reading a coverage from the given input. |
static void |
write(GridCoverage coverage,
String formatName,
Object output)
Convenience method writing a coverage to the given output. |
static void |
write(Iterable<? extends GridCoverage> coverages,
String formatName,
Object output)
Convenience method writing one of many coverages to the given output. |
static GridCoverageReader |
writeOrReuseMosaic(File input)
Creates a mosaic reader using a cache of tiles at different resolutions. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static GridCoverage read(Object input)
throws CoverageStoreException
File, URL or String object, but other types (especially
ImageInputStream) may be accepted as well depending
on the image format. The given input can also be an ImageReader
instance with its input initialized.
input - The input to read (typically a File).
CoverageStoreException - If the coverage can not be read.
public static void write(GridCoverage coverage,
String formatName,
Object output)
throws CoverageStoreException
File or String object, but other types (especially
ImageOutputStream) may be accepted as well depending
on the image format. The given input can also be an ImageWriter
instance with its output initialized.
coverage - The coverage to write.formatName - The image format as one of the Image I/O plugin name (e.g. "png"),
or null for auto-detection from the output file suffix.output - The output where to write the image (typically a File).
CoverageStoreException - If the coverage can not be written.
public static void write(Iterable<? extends GridCoverage> coverages,
String formatName,
Object output)
throws CoverageStoreException
File or String object, but other types (especially
ImageOutputStream) may be accepted as well depending
on the image format. The given input can also be an ImageWriter
instance with its output initialized.
coverages - The coverages to write.formatName - The image format as one of the Image I/O plugin name (e.g. "png"),
or null for auto-detection from the output file suffix.output - The output where to write the image (typically a File).
CoverageStoreException - If the coverages can not be written.
public static GridCoverageReader createSimpleReader(Object input)
throws CoverageStoreException
The input is typically a File, URL or String object, but other types
(especially ImageInputStream) may be accepted as well depending
on the image format. The given input can also be an ImageReader instance
with its input initialized.
input - The input to read (typically a File).
CoverageStoreException - If the reader can not be created for the given file.
public static GridCoverageWriter createSimpleWriter(Object output)
throws CoverageStoreException
The output is typically a File, URL or String object, but other types
(especially ImageOutputStream) may be accepted as well depending
on the image format. The given output can also be an ImageWriter instance
with its output initialized.
output - The output where to write (typically a File).
CoverageStoreException - If the writer can not be created for the given file.
public static GridCoverageReader createMosaicReader(Object input,
CoordinateReferenceSystem crs)
throws CoverageStoreException
TileManager, a File to
a serialized instance of TileManager, a directory, or an array or collection of
Tile instances.
The crs argument is optional if the input is a File, in which case this
method will attempt to parse a file of the same name with the ".prj" extension
using PrjFiles. For all other cases, the CRS argument is
mandatory.
input - The file, tiles or tile manager to use a input.crs - The coordinate reference system of the mosaic image.
CoverageStoreException - If the reader can not be created for the given tiles.
public static GridCoverageReader writeOrReuseMosaic(File input)
throws CoverageStoreException
The tiles will be created in a sub-directory having the same name than the given input,
with an additional ".tiles" extension.
input - The input to read.
CoverageStoreException - If the reader can not be created for the given file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||