org.geotoolkit.coverage.processing.operation
Class Resample

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

@Immutable
public class Resample
extends Operation2D

Resample a grid coverage using a different grid geometry. This operation provides the following functionality:

Name: "Resample"
JAI operator: "Affine" or "Warp"
Parameters:

Name Class Default value Minimum value Maximum value
"Source" GridCoverage2D N/A N/A N/A
"InterpolationType" CharSequence "NearestNieghbor" N/A N/A
"CoordinateReferenceSystem" CoordinateReferenceSystem Same as source grid coverage N/A N/A
"GridGeometry" GridGeometry (automatic) N/A N/A
"Background" double[] (automatic) N/A N/A


Geotoolkit.org extension
The "Resample" operation use the default CoordinateOperationFactory for creating a transformation from the source to the destination coordinate reference systems. If a custom factory is desired, it may be supplied as a rendering hint with the Hints.COORDINATE_OPERATION_FACTORY key. Rendering hints can be supplied to DefaultCoverageProcessor at construction time.

Geotk adds a background parameter which is not part of OGC specification. This parameter specifies the color to use for pixels in the destination image that don't map to a pixel in the source image. If this parameter is not specified, then it is inferred from the "no data" category in the source coverage.

Since:
2.2
Version:
3.16
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
Operations.resample(org.opengis.coverage.Coverage, org.opengis.referencing.crs.CoordinateReferenceSystem), WarpDescriptor, Serialized Form
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
static ParameterDescriptor<double[]> BACKGROUND
          The parameter descriptor for the background values.
static ParameterDescriptor<CoordinateReferenceSystem> COORDINATE_REFERENCE_SYSTEM
          The parameter descriptor for the coordinate reference system.
static ParameterDescriptor<GridGeometry> GRID_GEOMETRY
          The parameter descriptor for the grid geometry.
static ParameterDescriptor<Object> INTERPOLATION_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
Resample()
          Constructs a "Resample" operation.
 
Method Summary
static GridGeometry computeGridGeometry(GridCoverage source, Envelope target)
          Computes a grid geometry from a source coverage and a target envelope.
protected  Coverage doOperation(ParameterValueGroup parameters, Hints hints)
          Resamples a grid coverage.
 
Methods inherited from class Operation2D
extractSources, extractSources, getComputationView
 
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

INTERPOLATION_TYPE

public static final ParameterDescriptor<Object> INTERPOLATION_TYPE
The parameter descriptor for the interpolation type.


COORDINATE_REFERENCE_SYSTEM

public static final ParameterDescriptor<CoordinateReferenceSystem> COORDINATE_REFERENCE_SYSTEM
The parameter descriptor for the coordinate reference system.


GRID_GEOMETRY

public static final ParameterDescriptor<GridGeometry> GRID_GEOMETRY
The parameter descriptor for the grid geometry.


BACKGROUND

public static final ParameterDescriptor<double[]> BACKGROUND
The parameter descriptor for the background values.

Since:
3.16
Constructor Detail

Resample

public Resample()
Constructs a "Resample" operation.

Method Detail

doOperation

protected Coverage doOperation(ParameterValueGroup parameters,
                               Hints hints)
Resamples a grid coverage. This method is invoked by DefaultCoverageProcessor for the "Resample" 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.

computeGridGeometry

public static GridGeometry computeGridGeometry(GridCoverage source,
                                               Envelope target)
                                        throws TransformException
Computes a grid geometry from a source coverage and a target envelope. This is a convenience method for computing the GRID_GEOMETRY argument of a "resample" operation from an envelope. The target envelope may contains a different coordinate reference system, in which case a reprojection will be performed.

Parameters:
source - The source coverage.
target - The target envelope, including a possibly different coordinate reference system.
Returns:
A grid geometry inferred from the target envelope.
Throws:
TransformException - If a transformation was required and failed.
Since:
2.5


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