org.geotools.gc
Class GridCoverage.Export

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byorg.geotools.cv.Coverage.Export
                  extended byorg.geotools.gc.GridCoverage.Export
All Implemented Interfaces:
org.opengis.cv.CV_Coverage, org.opengis.gc.GC_GridCoverage, GridCoverage.Remote, javax.media.jai.PropertySource, java.rmi.Remote, java.io.Serializable
Enclosing class:
GridCoverage

protected class GridCoverage.Export
extends Coverage.Export
implements org.opengis.gc.GC_GridCoverage, GridCoverage.Remote

Export a Geotools GridCoverage as an OpenGIS GC_GridCoverage object. This class is suitable for RMI use. User should not create instance of this class directly. The method Adapters.export(GridCoverage) should be used instead.

Version:
$Id: GridCoverage.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.geotools.cv.Coverage.Export
adapters
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
protected GridCoverage.Export(Adapters adapters)
          Constructs a remote object.
 
Method Summary
 boolean[] getDataBlockAsBoolean(org.opengis.gc.GC_GridRange gridRange)
          Return a sequence of boolean values for a block.
 byte[] getDataBlockAsByte(org.opengis.gc.GC_GridRange gridRange)
          Return a sequence of byte values for a block.
 int[] getDataBlockAsInteger(org.opengis.gc.GC_GridRange gridRange)
          Return a sequence of int values for a block.
 org.opengis.gc.GC_GridGeometry getGridGeometry()
          Returns information for the grid coverage geometry.
 org.opengis.gc.GC_GridPacking getGridPacking()
          Returns information for the packing of grid coverage values.
 javax.media.jai.Interpolation getInterpolation()
          Returns the interpolation used for evaluate(...)
 int getNumOverviews()
          Returns the number of predetermined overviews for the grid.
 int getNumSources()
          Returns the number of grid coverages which the grid coverage was derived from.
 int[] getOptimalDataBlockSizes()
          Returns the optimal size to use for each dimension when accessing grid values.
 org.opengis.gc.GC_GridCoverage getOverview(int overviewIndex)
          Returns a pre-calculated overview for a grid coverage.
 org.opengis.gc.GC_GridGeometry getOverviewGridGeometry(int overviewIndex)
          Return the grid geometry for an overview.
 byte[] getPackedDataBlock(org.opengis.gc.GC_GridRange gridRange)
          Return a block of grid coverage data for all sample dimensions.
 java.awt.image.RenderedImage getRenderedImage()
          Returns the underlying RenderedImage for this GC_GridCoverage.
 org.opengis.gc.GC_GridCoverage getSource(int sourceDataIndex)
          Returns the source data for a grid coverage.
 double[] getValueBlockAsDouble(org.opengis.gc.GC_GridRange gridRange)
          Return a sequence of double values for a block.
 boolean isDataEditable()
          Returns true if grid data can be edited.
 void setDataBlockAsBoolean(org.opengis.gc.GC_GridRange gridRange, boolean[] values)
          Set a block of boolean values for all sample dimensions.
 void setDataBlockAsByte(org.opengis.gc.GC_GridRange gridRange, byte[] values)
          Set a block of byte values for all sample dimensions.
 void setDataBlockAsDouble(org.opengis.gc.GC_GridRange gridRange, double[] values)
          Set a block of double values for all sample dimensions.
 void setDataBlockAsInteger(org.opengis.gc.GC_GridRange gridRange, int[] values)
          Set a block of bint values for all sample dimensions.
 void setPackedDataBlock(org.opengis.gc.GC_GridRange gridRange, byte[] values)
          Set a block of grid coverage data for all sample dimensions.
 
Methods inherited from class org.geotools.cv.Coverage.Export
evaluate, evaluateAsBoolean, evaluateAsByte, evaluateAsDouble, evaluateAsInteger, getCoordinateSystem, getDimensionNames, getEnvelope, getMetadataNames, getMetadataValue, getNumSampleDimensions, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleDimension
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.cv.CV_Coverage
evaluate, evaluateAsBoolean, evaluateAsByte, evaluateAsDouble, evaluateAsInteger, getCoordinateSystem, getDimensionNames, getEnvelope, getMetadataNames, getMetadataValue, getNumSampleDimensions, getSampleDimension
 

Constructor Detail

GridCoverage.Export

protected GridCoverage.Export(Adapters adapters)
                       throws java.rmi.RemoteException
Constructs a remote object. This object is automatically added to the cache in the enclosing GridCoverage object. The cached Export instance can be queried with Adapters.export(GridCoverage).

Parameters:
adapters - The originating adapter.
Throws:
java.rmi.RemoteException - if this object can't be exported through RMI.
Method Detail

getNumSources

public int getNumSources()
                  throws java.rmi.RemoteException
Returns the number of grid coverages which the grid coverage was derived from. The default implementation invokes GridCoverage.getSources().

Specified by:
getNumSources in interface org.opengis.cv.CV_Coverage
Overrides:
getNumSources in class Coverage.Export
Returns:
the number of grid coverages which this coverage was derived from.
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getSource

public org.opengis.gc.GC_GridCoverage getSource(int sourceDataIndex)
                                         throws java.rmi.RemoteException
Returns the source data for a grid coverage. The default implementation invokes GridCoverage.getSources().

Specified by:
getSource in interface org.opengis.cv.CV_Coverage
Overrides:
getSource in class Coverage.Export
Parameters:
sourceDataIndex - Source grid coverage index. Indexes start at 0.
Returns:
the source data for a grid coverage.
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

isDataEditable

public boolean isDataEditable()
                       throws java.rmi.RemoteException
Returns true if grid data can be edited. The default implementation invokes GridCoverage.isDataEditable().

Specified by:
isDataEditable in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getGridPacking

public org.opengis.gc.GC_GridPacking getGridPacking()
                                             throws java.rmi.RemoteException
Returns information for the packing of grid coverage values.

Specified by:
getGridPacking in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getGridGeometry

public org.opengis.gc.GC_GridGeometry getGridGeometry()
                                               throws java.rmi.RemoteException
Returns information for the grid coverage geometry. The default implementation invokes GridCoverage.getGridGeometry().

Specified by:
getGridGeometry in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getOverviewGridGeometry

public org.opengis.gc.GC_GridGeometry getOverviewGridGeometry(int overviewIndex)
                                                       throws java.rmi.RemoteException
Return the grid geometry for an overview. The default implementation throws an ArrayIndexOutOfBoundsException, since getNumOverviews() returned 0.

Specified by:
getOverviewGridGeometry in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getNumOverviews

public int getNumOverviews()
                    throws java.rmi.RemoteException
Returns the number of predetermined overviews for the grid. The default implementation returns 0, since this feature is not yet implemented. It may be implemented in a future version.

Specified by:
getNumOverviews in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getOverview

public org.opengis.gc.GC_GridCoverage getOverview(int overviewIndex)
                                           throws java.rmi.RemoteException
Returns a pre-calculated overview for a grid coverage. The default implementation throws an ArrayIndexOutOfBoundsException, since getNumOverviews() returned 0.

Specified by:
getOverview in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getOptimalDataBlockSizes

public int[] getOptimalDataBlockSizes()
                               throws java.rmi.RemoteException
Returns the optimal size to use for each dimension when accessing grid values. The default implementation returns the image's tiles size.

Specified by:
getOptimalDataBlockSizes in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getDataBlockAsBoolean

public boolean[] getDataBlockAsBoolean(org.opengis.gc.GC_GridRange gridRange)
                                throws java.rmi.RemoteException
Return a sequence of boolean values for a block.

Specified by:
getDataBlockAsBoolean in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getDataBlockAsByte

public byte[] getDataBlockAsByte(org.opengis.gc.GC_GridRange gridRange)
                          throws java.rmi.RemoteException
Return a sequence of byte values for a block.

Specified by:
getDataBlockAsByte in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getDataBlockAsInteger

public int[] getDataBlockAsInteger(org.opengis.gc.GC_GridRange gridRange)
                            throws java.rmi.RemoteException
Return a sequence of int values for a block.

Specified by:
getDataBlockAsInteger in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getValueBlockAsDouble

public double[] getValueBlockAsDouble(org.opengis.gc.GC_GridRange gridRange)
                               throws java.rmi.RemoteException
Return a sequence of double values for a block.

Specified by:
getValueBlockAsDouble in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getPackedDataBlock

public byte[] getPackedDataBlock(org.opengis.gc.GC_GridRange gridRange)
                          throws java.rmi.RemoteException
Return a block of grid coverage data for all sample dimensions.

Specified by:
getPackedDataBlock in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

setDataBlockAsBoolean

public void setDataBlockAsBoolean(org.opengis.gc.GC_GridRange gridRange,
                                  boolean[] values)
                           throws java.rmi.RemoteException
Set a block of boolean values for all sample dimensions.

Specified by:
setDataBlockAsBoolean in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

setDataBlockAsByte

public void setDataBlockAsByte(org.opengis.gc.GC_GridRange gridRange,
                               byte[] values)
                        throws java.rmi.RemoteException
Set a block of byte values for all sample dimensions.

Specified by:
setDataBlockAsByte in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

setDataBlockAsInteger

public void setDataBlockAsInteger(org.opengis.gc.GC_GridRange gridRange,
                                  int[] values)
                           throws java.rmi.RemoteException
Set a block of bint values for all sample dimensions.

Specified by:
setDataBlockAsInteger in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

setDataBlockAsDouble

public void setDataBlockAsDouble(org.opengis.gc.GC_GridRange gridRange,
                                 double[] values)
                          throws java.rmi.RemoteException
Set a block of double values for all sample dimensions.

Specified by:
setDataBlockAsDouble in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

setPackedDataBlock

public void setPackedDataBlock(org.opengis.gc.GC_GridRange gridRange,
                               byte[] values)
                        throws java.rmi.RemoteException
Set a block of grid coverage data for all sample dimensions.

Specified by:
setPackedDataBlock in interface org.opengis.gc.GC_GridCoverage
Throws:
java.rmi.RemoteException - if a remote call failed. More specifically, the exception will be an instance of ServerException if an error occurs on the server side.

getRenderedImage

public java.awt.image.RenderedImage getRenderedImage()
                                              throws java.io.IOException
Returns the underlying RenderedImage for this GC_GridCoverage. This method usually returns an instance of SerializableRenderedImage, which is appropriate for use through a RMI API.

Specified by:
getRenderedImage in interface GridCoverage.Remote
Throws:
java.rmi.RemoteException - if the remote connection failed.
java.io.NotSerializableException - if the image is not serializable.
java.io.IOException

getInterpolation

public javax.media.jai.Interpolation getInterpolation()
                                               throws java.rmi.RemoteException
Returns the interpolation used for evaluate(...) methods.

Specified by:
getInterpolation in interface GridCoverage.Remote
Returns:
The interpolation.
Throws:
java.rmi.RemoteException - if the remote connection failed.


Copyright © GeoTools. All Rights Reserved.