org.geotoolkit.coverage.processing.operation
Class SelectSampleDimension

Object
  extended by AbstractOperation
      extended by Operation2D
          extended by SelectSampleDimension
All Implemented Interfaces:
Serializable, Operation

@Immutable
public class SelectSampleDimension
extends Operation2D

Chooses N sample dimensions from a grid coverage and copies their sample data to the destination grid coverage in the order specified. The "SampleDimensions" parameter specifies the source GridSampleDimension indices, and its size (SampleDimensions.length) determines the number of sample dimensions of the destination grid coverage. The destination coverage may have any number of sample dimensions, and a particular sample dimension of the source coverage may be repeated in the destination coverage by specifying it multiple times in the "SampleDimensions" parameter.

Name: "SelectSampleDimension"
JAI operator: "BandSelect"
Parameters:

Name Class Default value Minimum value Maximum value
"Source" GridCoverage2D N/A N/A N/A
"SampleDimensions" int[] Same as source N/A N/A
"VisibleSampleDimension" Integer Same as source 0 N/A


Geotoolkit.org extension
This operation can also be used for selecting a different "visible sample dimension". Some images may contain useful data in more than one sample dimension, but renderer the content using only 1 sample dimension at time. The "VisibleSampleDimension" parameter can be used for selecting this sample dimension. If omitted, then the new grid coverage will inherit its source's visible sample dimension.

Since:
2.0
Version:
3.00
Author:
Martin Desruisseaux (IRD)
See Also:
Operations.selectSampleDimension(org.opengis.coverage.Coverage, int...), BandSelectDescriptor, Serialized Form
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
static ParameterDescriptor<int[]> SAMPLE_DIMENSIONS
          The parameter descriptor for the sample dimension indices.
static ParameterDescriptor<Integer> VISIBLE_SAMPLE_DIMENSION
          The parameter descriptor for the visible dimension indice.
 
Fields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0, SOURCE_1, SOURCE_2
 
Fields inherited from class AbstractOperation
descriptor
 
Constructor Summary
SelectSampleDimension()
          Constructs a default "SelectSampleDimension" operation.
 
Method Summary
protected  Coverage doOperation(ParameterValueGroup parameters, Hints hints)
          Applies the band select operation to a grid coverage.
protected  ViewType getComputationView(ParameterValueGroup parameters)
          Returns ViewType.SAME as the preferred view for computation purpose.
 
Methods inherited from class Operation2D
extractSources, extractSources
 
Methods inherited from class AbstractOperation
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

SAMPLE_DIMENSIONS

public static final ParameterDescriptor<int[]> SAMPLE_DIMENSIONS
The parameter descriptor for the sample dimension indices.


VISIBLE_SAMPLE_DIMENSION

public static final ParameterDescriptor<Integer> VISIBLE_SAMPLE_DIMENSION
The parameter descriptor for the visible dimension indice. This is a Geotk-specific parameter.

Constructor Detail

SelectSampleDimension

public SelectSampleDimension()
Constructs a default "SelectSampleDimension" operation.

Method Detail

getComputationView

protected ViewType getComputationView(ParameterValueGroup parameters)
Returns ViewType.SAME as the preferred view for computation purpose.

Overrides:
getComputationView in class Operation2D
Parameters:
parameters - The parameters supplied by the user to the doOperation method.
Returns:
The view on which computation should be performed.
See Also:
GridCoverage2D.view(ViewType)

doOperation

protected Coverage doOperation(ParameterValueGroup parameters,
                               Hints hints)
Applies the band select operation to a grid coverage. This method is invoked by DefaultCoverageProcessor for the "SelectSampleDimension" operation.

Specified by:
doOperation in class AbstractOperation
Parameters:
parameters - List of name value pairs for the parameters.
hints - A set of rendering hints, or null if none.
Returns:
The result as a grid coverage.


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