org.deegree_impl.model.gc
Class GC_GridCoverageExchange_Impl

java.lang.Object
  extended byorg.deegree_impl.model.gc.GC_GridCoverageExchange_Impl
All Implemented Interfaces:
GC_GridCoverageExchange, java.rmi.Remote

public class GC_GridCoverageExchange_Impl
extends java.lang.Object
implements GC_GridCoverageExchange

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.

Since:
1.00
Version:
1.00
Author:
Andreas Poth

Field Summary
private static GC_Format[] formats
           
private  java.util.HashMap metadata
           
private  int numFormats
           
 
Constructor Summary
GC_GridCoverageExchange_Impl()
          defualt constructor
GC_GridCoverageExchange_Impl(GC_Parameter[] metadata)
          constructor initializing the GC_GridCoverageExchange with user defined metadata
 
Method Summary
 GC_GridCoverage createFromName(java.lang.String name)
          Create a new GC_GridCoverage from a grid coverage file.
 GC_GridCoverage createFromSubName(java.lang.String name, java.lang.String subName)
          Create a new GC_GridCoverage from a file where the file contains many grid coverages.
 void exportTo(GC_GridCoverage gridCoverage, java.lang.String fileFormat, java.lang.String fileName, GC_Parameter[] creationOptions)
          Export a grid coverage to a persistent file format.
 GC_Format getFormat(int index)
          Retrieve information on file formats or resources available with the GC_GridCoverageExchange implementation.
 java.lang.String[] getMetadataNames()
          List of metadata keywords for the interface.
 java.lang.String getMetadataValue(java.lang.String name)
          Retrieve the metadata value for a given metadata name.
 int getNumFormats()
          The number of formats supported by the GC_GridCoverageExchange.
 java.lang.String[] listSubNames(java.lang.String name)
          Retrieve the list of grid coverages contained within the given file or resource.
 GC_GridCoverage move(GC_GridCoverage gridCoverage, CS_CoordinateSystem coordsys, CT_MathTransform gridToCoordinateSystem)
          Create a new coverage with a different coordinate reference system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metadata

private java.util.HashMap metadata

numFormats

private int numFormats

formats

private static GC_Format[] formats
Constructor Detail

GC_GridCoverageExchange_Impl

public GC_GridCoverageExchange_Impl()
defualt constructor


GC_GridCoverageExchange_Impl

public GC_GridCoverageExchange_Impl(GC_Parameter[] metadata)
constructor initializing the GC_GridCoverageExchange with user defined metadata

Parameters:
metadata - Metadata of the GC_GridCoverageExchange
Method Detail

createFromName

public GC_GridCoverage createFromName(java.lang.String name)
                               throws java.rmi.RemoteException
Create a new GC_GridCoverage from a grid coverage file. This method is meant to allow implementations to create a GC_GridCoverage. from any file format. An implementation can support any number of formats which is determined from the GC_Format interface.

Specified by:
createFromName in interface GC_GridCoverageExchange
Parameters:
name - File name (including path) from which to create a grid coverage interface. This file name can be any valid file name within the underlying operating system of the server or a valid string, such as a URL which specifics a grid coverage. Each implementation must determine if file name is valid for it's own use.
Returns:
a new GC_GridCoverage.
Throws:
java.rmi.RemoteException - if a remote method call failed.

createFromSubName

public GC_GridCoverage createFromSubName(java.lang.String name,
                                         java.lang.String subName)
                                  throws java.rmi.RemoteException
Create a new GC_GridCoverage from a file where the file contains many grid coverages. This method is meant to allow implementations to create a GC_GridCoverage from any file format which contains many grid coverages. An example of such a format is HDF-EOS format.

Specified by:
createFromSubName in interface GC_GridCoverageExchange
Parameters:
name - File name (including path) from which to create a grid coverage interface. This file name can be any valid file name within the underlying operating system of the server or a valid string, such as a URL which specifics a grid coverage. Each implementation must determine if name is valid for it's own use.
subName - Name of grid coverage contained in file name or resource.
Returns:
a new GC_GridCoverage from a file where the file contains many grid coverages.
Throws:
java.rmi.RemoteException - if a remote method call failed.

exportTo

public void exportTo(GC_GridCoverage gridCoverage,
                     java.lang.String fileFormat,
                     java.lang.String fileName,
                     GC_Parameter[] creationOptions)
              throws java.rmi.RemoteException
Export a grid coverage to a persistent file format. The file format types are implementation specific. The file format name is determined from the GC_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
 
Other file format names are implementation dependent.

Specified by:
exportTo in interface GC_GridCoverageExchange
Parameters:
gridCoverage - Source grid coverage.
fileFormat - String which indicates exported file format.
fileName - File name to store grid coverage. This file name can be any valid file name within the underlying operating system of the server.
creationOptions - Options to use for creating the file. These options are implementation specific are the valid options is determined from the GC_Format interface.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getFormat

public GC_Format getFormat(int index)
                    throws java.rmi.RemoteException
Retrieve information on file formats or resources available with the GC_GridCoverageExchange implementation. Indices start at zero.

Specified by:
getFormat in interface GC_GridCoverageExchange
Parameters:
index - Index for which to retrieve the format information.
Returns:
information on file formats or resources available with the GC_GridCoverageExchange implementation.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getMetadataNames

public java.lang.String[] getMetadataNames()
                                    throws java.rmi.RemoteException
List of metadata keywords for the interface. If no metadata is available, the sequnce will be empty.

Specified by:
getMetadataNames in interface GC_GridCoverageExchange
Returns:
the list of metadata keywords for the interface.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getMetadataValue

public java.lang.String getMetadataValue(java.lang.String name)
                                  throws java.rmi.RemoteException
Retrieve the metadata value for a given metadata name.

Specified by:
getMetadataValue in interface GC_GridCoverageExchange
Parameters:
name - Metadata keyword for which to retrieve metadata.
Returns:
the metadata value for the given metadata name.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getNumFormats

public int getNumFormats()
                  throws java.rmi.RemoteException
The number of formats supported by the GC_GridCoverageExchange.

Specified by:
getNumFormats in interface GC_GridCoverageExchange
Returns:
the number of formats supported by the GC_GridCoverageExchange.
Throws:
java.rmi.RemoteException - if a remote method call failed.

listSubNames

public java.lang.String[] listSubNames(java.lang.String name)
                                throws java.rmi.RemoteException
Retrieve the list of grid coverages contained within the given file or resource. 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 sequence will be returned if no sub names exist.

Specified by:
listSubNames in interface GC_GridCoverageExchange
Parameters:
name - File name (including path) from which to retrieve the grid coverage names. This file name can be any valid file name within the underlying operating system of the server or a valid string, such as a URL which specifics a grid coverage. Each implementation must determine if file name is valid for it s own use. Implementations can support many different of file formats.
Returns:
The list of grid coverages contained within the given file or resource.
Throws:
java.rmi.RemoteException - if a remote method call failed.

move

public GC_GridCoverage move(GC_GridCoverage gridCoverage,
                            CS_CoordinateSystem coordsys,
                            CT_MathTransform gridToCoordinateSystem)
                     throws java.rmi.RemoteException
Create a new coverage with a different coordinate reference system.

Specified by:
move in interface GC_GridCoverageExchange
Parameters:
gridCoverage - Source grid coverage.
coordsys - Coordinate system of the new grid coverage.
gridToCoordinateSystem - Math transform to assign to grid coverage.
Returns:
a new coverage with a different coordinate reference system.
Throws:
java.rmi.RemoteException - if a remote method call failed.