org.geotoolkit.coverage.processing.operation
Class Interpolate

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

@Immutable
public class Interpolate
extends Operation2D

Specifies the interpolation type to be used to interpolate values for points which fall between grid cells. The default value is nearest neighbor. The new interpolation type operates on all sample dimensions. Possible values for type are: "NearestNeighbor", "Bilinear" and "Bicubic" (the "Optimal" interpolation type is currently not supported).


Geotoolkit.org extension
The Geotk implementation provides two extensions to OpenGIS specification: First, it accepts also an Interpolation argument type, for inter-operability with Java Advanced Imaging. Second, it accepts also an array of String or Interpolation objects. When an array is specified, the first interpolation in the array is applied. If this interpolation returns a NaN value, then the second interpolation is tried as a fallback. If the second interpolation returns also a NaN value, then the third one is tried and so on until an interpolation returns a real number or until we reach the end of interpolation list. This behavior is convenient when processing remote sensing images of geophysics data, for example Sea Surface Temperature (SST), in which clouds may mask many pixels (i.e. set them to some NaN values). Because "Bicubic" interpolation needs 4×4 pixels while "Bilinear" interpolation needs only 2x2 pixels, the "Bilinear" interpolation is less likely to fails because of clouds (NaN values) than the "Bicubic" one (note: only one NaN value is enough to make an interpolation fails). One can workaround the problem by trying a bicubic interpolation first, then a linear interpolation if "Bicubic" failed at a particular location, etc. This behavior can be specified with the following "Type" argument:

new String[] {"Bicubic", "Bilinear", "NearestNeighbor"}

Name: "Interpolate"
JAI operator: N/A
Parameters:

Name Class Default value Minimum value Maximum value
"Source" GridCoverage2D N/A N/A N/A
"Type" CharSequence "NearestNeighbor" N/A N/A

Since:
2.2
Version:
3.00
Author:
Martin Desruisseaux (IRD)
See Also:
Operations.interpolate(org.opengis.coverage.grid.GridCoverage, java.lang.String), Interpolator2D, Serialized Form
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
static ParameterDescriptor<Object> TYPE
          The parameter descriptor for the interpolation type.
 
Fields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0, SOURCE_1, SOURCE_2
 
Fields inherited from class AbstractOperation
descriptor
 
Constructor Summary
Interpolate()
          Constructs an "Interpolate" operation.
 
Method Summary
protected  Coverage doOperation(ParameterValueGroup parameters, Hints hints)
          Applies an interpolation 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

TYPE

public static final ParameterDescriptor<Object> TYPE
The parameter descriptor for the interpolation type. Values should be either a String or an Interpolation object.

Constructor Detail

Interpolate

public Interpolate()
Constructs an "Interpolate" 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 an interpolation to a grid coverage. This method is invoked by DefaultCoverageProcessor for the "Interpolate" operation.

Specified by:
doOperation in class AbstractOperation
Parameters:
parameters - List of name value pairs for the parameters required for the operation.
hints - A set of rendering hints, or null if none. The DefaultCoverageProcessor may provides hints for the following keys: Hints.COORDINATE_OPERATION_FACTORY and Hints.JAI_INSTANCE.
Returns:
The result as a coverage.


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