Class Resample
Object
AbstractOperation
Operation2D
Resample
- All Implemented Interfaces:
 Serializable,Operation
Resample a grid coverage using a different grid geometry. This operation provides the following functionality:
 
   
- Resampling
The grid coverage can be resampled at a different cell resolution. Some implementations may be able to do resampling efficiently at any resolution. Also a non-rectilinear grid coverage can be accessed as rectilinear grid coverage with this operation. - Reprojecting
The new grid geometry can have a different coordinate reference system than the underlying grid geometry. For example, a grid coverage can be reprojected from a geodetic coordinate reference system to Universal Transverse Mercator CRS. - Subsetting
A subset of a grid can be viewed as a separate coverage by using this operation with a grid geometry which as the same geoferencing and a region. Grid range in the grid geometry defines the region to subset in the grid coverage. 
Geotools 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 org.geotools.coverage.processing.DefaultProcessor at construction time.
 
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 | 
     "NearestNeighbor" | N/A | N/A | 
"CoordinateReferenceSystem" | 
     CoordinateReferenceSystem | 
     Same as source grid coverage | N/A | N/A | 
"GridGeometry" | 
     GridGeometry | 
     (automatic) | N/A | N/A | 
"BackgroundValues" | 
     double[] | 
     N/A | N/A | N/A | 
- Since:
 - 2.2
 - Author:
 - Martin Desruisseaux (IRD), Giannecchini Simone, GeoSolutions SAS, Daniele Romagnoli, GeoSolutions SAS
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterDescriptor<double[]>The parameter descriptor for the BackgroundValues.static final ParameterDescriptor<CoordinateReferenceSystem>The parameter descriptor for the coordinate reference system.static final StringKey for the warp grid dimensions, available only if a WarpGrid is being used.static final ParameterDescriptor<GridGeometry>The parameter descriptor for the grid geometry.static final ParameterDescriptor<Object>The parameter descriptor for the interpolation type.static final StringKey for the reprojection operation being used (null if no operation is performed)static final StringKey for the warp operationClass, null otherwiseFields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0Fields inherited from class AbstractOperation
descriptor - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic GridGeometrycomputeGridGeometry(GridCoverage source, Bounds target) Computes a grid geometry from a source coverage and a target envelope.doOperation(ParameterValueGroup parameters, Hints hints) Resamples a grid coverage.Methods inherited from class Operation2D
extractSources, getFactoryMethods inherited from class AbstractOperation
equals, getDescription, getDocURL, getName, getNumSources, getParameters, getVendor, getVersion, hashCode, toString 
- 
Field Details
- 
INTERPOLATION_TYPE
The parameter descriptor for the interpolation type. - 
COORDINATE_REFERENCE_SYSTEM
The parameter descriptor for the coordinate reference system. - 
GRID_GEOMETRY
The parameter descriptor for the grid geometry. - 
BACKGROUND_VALUES
The parameter descriptor for the BackgroundValues. - 
OPERATION
Key for the reprojection operation being used (null if no operation is performed)- See Also:
 
 - 
WARP_TYPE
Key for the warp operationClass, null otherwise- See Also:
 
 - 
GRID_DIMENSIONS
Key for the warp grid dimensions, available only if a WarpGrid is being used. Returned as aDimensionobject- See Also:
 
 
 - 
 - 
Constructor Details
- 
Resample
public Resample()Constructs a"Resample"operation. 
 - 
 - 
Method Details
- 
doOperation
Resamples a grid coverage. This method is invoked byorg.geotools.coverage.processing.DefaultProcessorfor the"Resample"operation.- Specified by:
 doOperationin classAbstractOperation- Parameters:
 parameters- List of name value pairs for the parameters required for the operation.hints- A set of rendering hints, ornullif none. TheDefaultProcessormay provides hints for the following keys:Hints.COORDINATE_OPERATION_FACTORYandHints.JAI_INSTANCE.- Returns:
 - The result as a coverage.
 
 - 
computeGridGeometry
public static GridGeometry computeGridGeometry(GridCoverage source, Bounds target) throws TransformException Computes a grid geometry from a source coverage and a target envelope. This is a convenience method for computing theGRID_GEOMETRYargument 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
 
 
 -