org.geotoolkit.coverage.processing
Class Operation2D

Object
  extended by AbstractOperation
      extended by Operation2D
All Implemented Interfaces:
Serializable, Operation
Direct Known Subclasses:
IndexColorOperation, Interpolate, OperationJAI, Resample, SelectSampleDimension

Deprecated. The API of this class will change in a future Geotk release. Do not rely on it.

@Immutable
@Deprecated
public abstract class Operation2D
extends AbstractOperation

An operation working on a two-dimensional slice of a coverage. The current implementation requires the source to be instances of GridCoverage2D, but this restriction may be relaxed in a future version.

This base class does not really impose any restriction about what the doOperation method can do, but it provides convenience methods for extracting the sources as GridCoverage2D objects.

Since:
1.2
Version:
3.00
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
Serialized Form
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
protected static int PRIMARY_SOURCE_INDEX
          Deprecated. Index of the source GridCoverage2D to use as a model.
static ParameterDescriptor<GridCoverage2D> SOURCE_0
          Deprecated. Convenience constant for the first source GridCoverage2D.
static ParameterDescriptor<GridCoverage2D> SOURCE_1
          Deprecated. Convenience constant for the second source GridCoverage2D.
static ParameterDescriptor<GridCoverage2D> SOURCE_2
          Deprecated. Convenience constant for the third source GridCoverage2D.
 
Fields inherited from class AbstractOperation
descriptor
 
Constructor Summary
protected Operation2D(ParameterDescriptorGroup descriptor)
          Deprecated. Constructs an operation.
 
Method Summary
protected  ViewType extractSources(ParameterValueGroup parameters, GridCoverage2D[] sources)
          Deprecated. Extracts and prepares the sources for this Operation2D, assuming that the parameters use the standard names for the sources.
protected  ViewType extractSources(ParameterValueGroup parameters, String[] sourceNames, GridCoverage2D[] sources)
          Deprecated. Extracts and prepares the sources for this Operation2D, knowing that the parameters use the given names for the sources.
protected  ViewType getComputationView(ParameterValueGroup parameters)
          Deprecated. Returns the view of GridCoverage2D to use for computation purpose.
 
Methods inherited from class AbstractOperation
doOperation, equals, getDescription, getDocURL, getName, getNumSources, getParameters, getVendor, getVersion, hashCode, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIMARY_SOURCE_INDEX

protected static final int PRIMARY_SOURCE_INDEX
Deprecated. 
Index of the source GridCoverage2D to use as a model. The destination grid coverage will reuse the same coordinate reference system, envelope and qualitative categories than this primary source.

For operations expecting only one source, there is no ambiguity. But for operations expecting more than one source, the choice of a primary source is somewhat arbitrary. This constant is used merely as a flag for spotting those places in the code.

Since:
2.4
See Also:
Constant Field Values

SOURCE_0

public static final ParameterDescriptor<GridCoverage2D> SOURCE_0
Deprecated. 
Convenience constant for the first source GridCoverage2D. The parameter name is "Source" (as specified in OGC implementation specification) and the alias is "source0" (for compatibility with Java Advanced Imaging).


SOURCE_1

public static final ParameterDescriptor<GridCoverage2D> SOURCE_1
Deprecated. 
Convenience constant for the second source GridCoverage2D. The parameter name is "source1" (for compatibility with Java Advanced Imaging).

Since:
3.00

SOURCE_2

public static final ParameterDescriptor<GridCoverage2D> SOURCE_2
Deprecated. 
Convenience constant for the third source GridCoverage2D. The parameter name is "source2" (for compatibility with Java Advanced Imaging).

Since:
3.00
Constructor Detail

Operation2D

protected Operation2D(ParameterDescriptorGroup descriptor)
Deprecated. 
Constructs an operation. The operation name will be the same than the parameter descriptor name.

Parameters:
descriptor - The parameters descriptor.
Method Detail

getComputationView

protected ViewType getComputationView(ParameterValueGroup parameters)
Deprecated. 
Returns the view of GridCoverage2D to use for computation purpose. The default implementation conservatively returns ViewType.GEOPHYSICS in all case. This is a "conservative" implementation because this is often the only view which is guaranteed to be mainfull (assuming that a grid coverage has defined such a view). If computation should be performed on the data "as is" without any "samples to geophysics values" conversion, then subclasses should override this method and returns ViewType.SAME.

Parameters:
parameters - The parameters supplied by the user to the doOperation method.
Returns:
The view on which computation should be performed.
Since:
3.00
See Also:
GridCoverage2D.view(ViewType)

extractSources

protected ViewType extractSources(ParameterValueGroup parameters,
                                  GridCoverage2D[] sources)
                           throws ParameterNotFoundException,
                                  InvalidParameterValueException
Deprecated. 
Extracts and prepares the sources for this Operation2D, assuming that the parameters use the standard names for the sources. The expected number of sources is the length of the sources array. If this length is 1, then the parameter group is expected to contain a parameter named "Source" with a value of type GridCoverage2D. If the length of the sources array is greater then 1, then the parameter group is expected to contain parameters named "source0", "source1", ..., "sourcen" where n is the array length.

The source coverages extracted from the parameters are stored in the given sources array, taking into account the need for going to the geophysics view of the data in case this operation requires so.

Parameters:
parameters - Parameters that will control this operation.
sources - The array where to store the GridCoverage2D to be used as sources for this operation.
Returns:
The view of the result. The doOperation method should converts its result to that view.
Throws:
ParameterNotFoundException - If a required source has not been found.
InvalidParameterValueException - If a source doesn't contain a value of type GridCoverage2D.
Since:
3.00

extractSources

protected ViewType extractSources(ParameterValueGroup parameters,
                                  String[] sourceNames,
                                  GridCoverage2D[] sources)
                           throws ParameterNotFoundException,
                                  InvalidParameterValueException
Deprecated. 
Extracts and prepares the sources for this Operation2D, knowing that the parameters use the given names for the sources. The expected number of sources is the length of the names array. For each name at index i, a parameter having the name name[i] is expected to exist and have a value of type GridCoverage2D. The reference to this coverage is stored in sources[i] (overwriting any previous value), taking into account the need for going to the geophysics view of the data in case this operation requires so.

Parameters:
parameters - Parameters that will control this operation.
sourceNames - Names of the sources to extract from ParameterValueGroup.
sources - An array with the same length than sourceNames where to store the GridCoverage2D to be used as sources for this operation.
Returns:
The view of the result. The doOperation method should converts its result to that view.
Throws:
ParameterNotFoundException - if a required source has not been found.
InvalidParameterValueException - if a source doesn't contain a value of type GridCoverage2D.
Since:
2.4


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.