|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractOperation
Operation2D
@Immutable @Deprecated public abstract class Operation2D
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.
| 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 |
|---|
protected static final int PRIMARY_SOURCE_INDEX
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.
public static final ParameterDescriptor<GridCoverage2D> SOURCE_0
GridCoverage2D. The parameter name
is "Source" (as specified in OGC implementation specification) and the alias
is "source0" (for compatibility with Java Advanced Imaging).
public static final ParameterDescriptor<GridCoverage2D> SOURCE_1
GridCoverage2D. The parameter name
is "source1" (for compatibility with Java Advanced Imaging).
public static final ParameterDescriptor<GridCoverage2D> SOURCE_2
GridCoverage2D. The parameter name
is "source2" (for compatibility with Java Advanced Imaging).
| Constructor Detail |
|---|
protected Operation2D(ParameterDescriptorGroup descriptor)
descriptor - The parameters descriptor.| Method Detail |
|---|
protected ViewType getComputationView(ParameterValueGroup parameters)
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 - The parameters supplied by the user to the doOperation method.
GridCoverage2D.view(ViewType)
protected ViewType extractSources(ParameterValueGroup parameters,
GridCoverage2D[] sources)
throws ParameterNotFoundException,
InvalidParameterValueException
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 that will control this operation.sources - The array where to store the GridCoverage2D to be used as sources
for this operation.
doOperation method should converts its
result to that view.
ParameterNotFoundException - If a required source has not been found.
InvalidParameterValueException - If a source doesn't contain a value of type GridCoverage2D.
protected ViewType extractSources(ParameterValueGroup parameters,
String[] sourceNames,
GridCoverage2D[] sources)
throws ParameterNotFoundException,
InvalidParameterValueException
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 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.
doOperation method should converts its
result to that view.
ParameterNotFoundException - if a required source has not been found.
InvalidParameterValueException - if a source doesn't contain a value of type GridCoverage2D.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||