org.geotools.data.coverage.grid
Interface GridCoverageExchange

All Superinterfaces:
Factory

public interface GridCoverageExchange
extends Factory

Support for creation of grid coverages from persistent formats as well as exporting a grid coverage to a persistent formats. For example, it allows for creation of grid coverages from the GeoTIFF Well-known binary format and exporting to the GeoTIFF file format. Basic implementations only require creation of grid coverages from a file format or resource. More sophesticated implementations may extract the grid coverages from a database. In such case, a GridCoverageExchange instance will hold a connection to a specific database and the dispose() method will need to be invoked in order to close this connection.

Version:
2.0
Author:
OpenGIS® consortium
See Also:
GridCoverageReader, GridCoverageWriter

Method Summary
 void dispose()
          Allows any resources held by this object to be released.
 Format[] getFormats()
          Retrieve information on file formats or resources available with the GridCoverageExchange implementation.
 GridCoverageReader getReader(java.lang.Object source)
          Returns a grid coverage reader that can manage the specified source
 GridCoverageWriter getWriter(java.lang.Object destination, Format format)
          Returns a GridCoverageWriter that can write the specified format.
 boolean isAvailable()
          Test to see if this GridCoverageExchange is available, if it has all the appropriate libraries to construct a GridCoverageExchange.
 boolean setDataSource(java.lang.Object datasource)
          Returns true if the GridCoverageExchange knows how to communicate with the datasource.
 
Methods inherited from interface org.geotools.factory.Factory
getImplementationHints
 

Method Detail

getFormats

public Format[] getFormats()
Retrieve information on file formats or resources available with the GridCoverageExchange implementation.

Returns:
Information on file formats or resources available with the GridCoverageExchange implementation.

getReader

public GridCoverageReader getReader(java.lang.Object source)
                             throws java.io.IOException
Returns a grid coverage reader that can manage the specified source

Parameters:
source - An object that specifies somehow the data source. Can be a String, an InputStream, a FileChannel, whatever. It's up to the associated grid coverage reader to make meaningful use of it.
Returns:
The grid coverage reader.
Throws:
java.io.IOException - if the format is not recognized, or if an error occurs during reading.

getWriter

public GridCoverageWriter getWriter(java.lang.Object destination,
                                    Format format)
                             throws java.io.IOException
Returns a GridCoverageWriter that can write the specified format. The file format name is determined from the Format interface. Sample file formats include:
"GeoTIFF"   - GeoTIFF
"PIX"   - PCI Geomatics PIX
"HDF-EOS"   - NASA HDF-EOS
"NITF"   - National Image Transfer Format
"STDS-DEM"   - Standard Transfer Data Standard

Parameters:
destination - An object that specifies somehow the data destination. Can be a String, an OutputStream, a FileChannel, whatever. It's up to the associated grid coverage writer to make meaningful use of it.
format - the output format.
Returns:
The grid coverage writer.
Throws:
java.io.IOException - if an error occurs during reading.

dispose

public 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. Applications should call this method when they know they will no longer be using this GridCoverageExchange, especially if it was holding a connection to a database.

Throws:
java.io.IOException - if an error occured while disposing resources (for example closing a database connection).

isAvailable

public boolean isAvailable()
Test to see if this GridCoverageExchange is available, if it has all the appropriate libraries to construct a GridCoverageExchange.

Most GridCoverageExchange should return true, because geotools will distribute the appropriate libraries. Though it's not a bad idea for GridCoverageExchange to check to make sure that the libraries are there.

Returns:
true if and only if this GridCoverageExchange has all the appropriate jars on the classpath

setDataSource

public boolean setDataSource(java.lang.Object datasource)
Returns true if the GridCoverageExchange knows how to communicate with the datasource.

Parameters:
datasource - a Source of gridcoverages. Normally a Directory/Filesystem, or WMS
Returns:
true if GridCoverageEchange understands the datasource false otherwise


Copyright © GeoTools. All Rights Reserved.