org.geotools.cv
Class Coverage.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
All Implemented Interfaces:
org.opengis.cv.CV_Coverage, javax.media.jai.PropertySource, java.rmi.Remote, java.io.Serializable
Direct Known Subclasses:
GridCoverage.Export
Enclosing class:
Coverage

protected class Coverage.Export
extends java.rmi.server.UnicastRemoteObject
implements org.opengis.cv.CV_Coverage, javax.media.jai.PropertySource

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

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

Field Summary
protected  Adapters adapters
          The originating adapter.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
protected Coverage.Export(Adapters adapters)
          Constructs a remote object.
 
Method Summary
 java.lang.Object evaluate(org.opengis.pt.PT_CoordinatePoint point)
          Return the value vector for a given point in the coverage.
 boolean[] evaluateAsBoolean(org.opengis.pt.PT_CoordinatePoint point)
          Return a sequence of Boolean values for a given point in the coverage.
 byte[] evaluateAsByte(org.opengis.pt.PT_CoordinatePoint point)
          Return a sequence of unsigned byte values for a given point in the coverage.
 double[] evaluateAsDouble(org.opengis.pt.PT_CoordinatePoint point)
          Return a sequence of double values for a given point in the coverage.
 int[] evaluateAsInteger(org.opengis.pt.PT_CoordinatePoint point)
          Return a sequence of integer values for a given point in the coverage.
 org.opengis.cs.CS_CoordinateSystem getCoordinateSystem()
          Returns coordinate system used when accessing a coverage or grid coverage with the evaluate methods.
 java.lang.String[] getDimensionNames()
          Returns the names of each dimension in the coverage.
 org.opengis.pt.PT_Envelope getEnvelope()
          Returns the bounding box for the coverage domain in coordinate system coordinates.
 java.lang.String[] getMetadataNames()
          Returns the list of metadata keywords for a coverage.
 java.lang.String getMetadataValue(java.lang.String name)
          Retrieve the metadata value for a given metadata name.
 int getNumSampleDimensions()
          Returns The number of sample dimensions in the coverage.
 int getNumSources()
          Returns the number of grid coverages which the grid coverage was derived from.
 java.lang.Object getProperty(java.lang.String name)
          Returns the value of a property.
 java.lang.Class getPropertyClass(java.lang.String name)
          Returns the class expected to be returned by a request for the property with the specified name.
 java.lang.String[] getPropertyNames()
          Returns an array of Strings recognized as names by this property source.
 java.lang.String[] getPropertyNames(java.lang.String prefix)
          Returns an array of Strings recognized as names by this property source that begin with the supplied prefix.
 org.opengis.cv.CV_SampleDimension getSampleDimension(int index)
          Retrieve sample dimension information for the coverage.
 org.opengis.gc.GC_GridCoverage getSource(int sourceDataIndex)
          Returns the source data for a grid coverage.
 
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
 

Field Detail

adapters

protected final Adapters adapters
The originating adapter.

Constructor Detail

Coverage.Export

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

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

getDimensionNames

public java.lang.String[] getDimensionNames()
                                     throws java.rmi.RemoteException
Returns the names of each dimension in the coverage. The default implementation invokes Coverage.getDimensionNames(java.util.Locale).

Specified by:
getDimensionNames in interface org.opengis.cv.CV_Coverage
Returns:
the names of each dimension in the 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.

getNumSampleDimensions

public int getNumSampleDimensions()
                           throws java.rmi.RemoteException
Returns The number of sample dimensions in the coverage. The default implementation invokes Coverage.getSampleDimensions().

Specified by:
getNumSampleDimensions in interface org.opengis.cv.CV_Coverage
Returns:
the number of sample dimensions in the 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.

getSampleDimension

public org.opengis.cv.CV_SampleDimension getSampleDimension(int index)
                                                     throws java.rmi.RemoteException
Retrieve sample dimension information for the coverage. The default implementation invokes Coverage.getSampleDimensions().

Specified by:
getSampleDimension in interface org.opengis.cv.CV_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.

getNumSources

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

Specified by:
getNumSources in interface org.opengis.cv.CV_Coverage
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 throws an ArrayIndexOutOfBoundsException, since getNumSources() returned 0.

Specified by:
getSource in interface org.opengis.cv.CV_Coverage
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.

getMetadataNames

public java.lang.String[] getMetadataNames()
                                    throws java.rmi.RemoteException
Returns the list of metadata keywords for a coverage. The default implementation invokes getPropertyNames().

Specified by:
getMetadataNames in interface org.opengis.cv.CV_Coverage
Returns:
the list of metadata keywords for a 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.

getMetadataValue

public java.lang.String getMetadataValue(java.lang.String name)
                                  throws java.rmi.RemoteException
Retrieve the metadata value for a given metadata name. The default implementation invokes getProperty(java.lang.String) and replace Image.UndefinedProperty by null.

Specified by:
getMetadataValue in interface org.opengis.cv.CV_Coverage
Parameters:
name - Metadata keyword for which to retrieve data.
Returns:
the metadata value for a given metadata name.
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.

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns an array of Strings recognized as names by this property source. The default implementation invokes PropertySourceImpl.getPropertyNames().

Specified by:
getPropertyNames in interface javax.media.jai.PropertySource
Returns:
an array of strings giving the valid property names, or null.

getPropertyNames

public java.lang.String[] getPropertyNames(java.lang.String prefix)
Returns an array of Strings recognized as names by this property source that begin with the supplied prefix. The default implementation invokes PropertySourceImpl.getPropertyNames(String).

Specified by:
getPropertyNames in interface javax.media.jai.PropertySource
Returns:
an array of strings giving the valid property names.

getPropertyClass

public java.lang.Class getPropertyClass(java.lang.String name)
Returns the class expected to be returned by a request for the property with the specified name. If this information is unavailable, null will be returned.

Specified by:
getPropertyClass in interface javax.media.jai.PropertySource
Parameters:
name - the name of the property.
Returns:
The class expected to be return by a request for the value of this property, or null.

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the value of a property. If the property name is not recognized, then Image.UndefinedProperty will be returned.

Specified by:
getProperty in interface javax.media.jai.PropertySource
Parameters:
name - the name of the property.
Returns:
the value of the property, or the value Image.UndefinedProperty.

getCoordinateSystem

public org.opengis.cs.CS_CoordinateSystem getCoordinateSystem()
                                                       throws java.rmi.RemoteException
Returns coordinate system used when accessing a coverage or grid coverage with the evaluate methods. The default implementation invokes Coverage.getCoordinateSystem().

Specified by:
getCoordinateSystem in interface org.opengis.cv.CV_Coverage
Returns:
the coordinate system used when accessing a coverage or grid coverage with the evaluate methods.
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.

getEnvelope

public org.opengis.pt.PT_Envelope getEnvelope()
                                       throws java.rmi.RemoteException
Returns the bounding box for the coverage domain in coordinate system coordinates. The default implementation invokes Coverage.getEnvelope().

Specified by:
getEnvelope in interface org.opengis.cv.CV_Coverage
Returns:
the bounding box for the coverage domain in coordinate system coordinates.
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.

evaluate

public java.lang.Object evaluate(org.opengis.pt.PT_CoordinatePoint point)
                          throws java.rmi.RemoteException
Return the value vector for a given point in the coverage. The default implementation invokes one of other CV_Coverage method (for example evaluateAsDouble(org.opengis.pt.PT_CoordinatePoint)) according the underlying data type.

Specified by:
evaluate in interface org.opengis.cv.CV_Coverage
Parameters:
point - point at which to find the grid values.
Returns:
the value vector for a given point in the 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.
Task:
TODO: Check the underlying data type.

evaluateAsBoolean

public boolean[] evaluateAsBoolean(org.opengis.pt.PT_CoordinatePoint point)
                            throws java.rmi.RemoteException
Return a sequence of Boolean values for a given point in the coverage. The default implementation invokes Coverage.evaluate(CoordinatePoint, boolean[]).

Specified by:
evaluateAsBoolean in interface org.opengis.cv.CV_Coverage
Parameters:
point - point at which to find the coverage values.
Returns:
a sequence of boolean values for a given point in the 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.

evaluateAsByte

public byte[] evaluateAsByte(org.opengis.pt.PT_CoordinatePoint point)
                      throws java.rmi.RemoteException
Return a sequence of unsigned byte values for a given point in the coverage. The default implementation invokes Coverage.evaluate(CoordinatePoint, byte[]).

Specified by:
evaluateAsByte in interface org.opengis.cv.CV_Coverage
Parameters:
point - point at which to find the coverage values.
Returns:
a sequence of unsigned byte values for a given point in the 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.

evaluateAsInteger

public int[] evaluateAsInteger(org.opengis.pt.PT_CoordinatePoint point)
                        throws java.rmi.RemoteException
Return a sequence of integer values for a given point in the coverage. The default implementation invokes Coverage.evaluate(CoordinatePoint, int[]).

Specified by:
evaluateAsInteger in interface org.opengis.cv.CV_Coverage
Parameters:
point - point at which to find the grid values.
Returns:
a sequence of integer values for a given point in the 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.

evaluateAsDouble

public double[] evaluateAsDouble(org.opengis.pt.PT_CoordinatePoint point)
                          throws java.rmi.RemoteException
Return a sequence of double values for a given point in the coverage. The default implementation invokes Coverage.evaluate(CoordinatePoint, double[]).

Specified by:
evaluateAsDouble in interface org.opengis.cv.CV_Coverage
Parameters:
point - point at which to find the grid values.
Returns:
a sequence of double values for a given point in the 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.


Copyright © GeoTools. All Rights Reserved.