Package org.apache.sis.coverage.grid

# Class GridCoverageProcessor

Object
GridCoverageProcessor

All Implemented Interfaces:
  `Cloneable`

public class GridCoverageProcessor extends Object implements Cloneable
A predefined set of operations on grid coverages as convenience methods.

## Thread-safety

`GridCoverageProcessor` is safe for concurrent use in multi-threading environment.

Since:
  1.1
See Also:
  - `ImageProcessor`

Defined in the `sis-feature` module

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final ImageProcessor`
  `imageProcessor`
  The processor to use for operations on two-dimensional slices.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GridCoverageProcessor()`
  Creates a new processor with default configuration.
  `GridCoverageProcessor(ImageProcessor processor)`
  Creates a new processor initialized to the given configuration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `GridCoverageProcessor`
  `clone()`
  Returns a coverage processor with the same configuration than this processor.
  `boolean`
  `equals(Object object)`
  Returns `true` if the given object is a coverage processor of the same class with the same configuration.
  `Interpolation`
  `getInterpolation()`
  Returns the interpolation method to use for resampling operations.
  `Quantity<?>[]`
  `getPositionalAccuracyHints()`
  Returns hints about the desired positional accuracy, in "real world" units or in pixel units.
  `int`
  `hashCode()`
  Returns a hash code value for this coverage processor based on its current configuration.
  `GridCoverage`
  `resample(GridCoverage source, GridGeometry target)`
  Creates a new coverage with a different grid extent, resolution or coordinate reference system.
  `void`
  `setInterpolation(Interpolation method)`
  Sets the interpolation method to use for resampling operations.
  `void`
  `setPositionalAccuracyHints(Quantity<?>... hints)`
  Sets hints about desired positional accuracy, in "real world" units or in pixel units.

  ### Methods inherited from class Object

  `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### imageProcessor

    protected final ImageProcessor imageProcessor
    The processor to use for operations on two-dimensional slices.

- ## Constructor Details

  - ### GridCoverageProcessor

    public GridCoverageProcessor()
    Creates a new processor with default configuration.

  - ### GridCoverageProcessor

    public GridCoverageProcessor(ImageProcessor processor)
    Creates a new processor initialized to the given configuration.
    Parameters:
      `processor` - the processor to use for operations on two-dimensional slices.

- ## Method Details

  - ### getInterpolation

    public Interpolation getInterpolation()
    Returns the interpolation method to use for resampling operations. The default implementation delegates to the image processor.
    Returns:
      interpolation method to use in resampling operations.
    See Also:
      - `ImageProcessor​.getInterpolation()`

  - ### setInterpolation

    public void setInterpolation(Interpolation method)
    Sets the interpolation method to use for resampling operations. The default implementation delegates to the image processor.
    Parameters:
      `method` - interpolation method to use in resampling operations.
    See Also:
      - `ImageProcessor​.setInterpolation(Interpolation)`

  - ### getPositionalAccuracyHints

    public Quantity<?>[] getPositionalAccuracyHints()
    Returns hints about the desired positional accuracy, in "real world" units or in pixel units. The default implementation delegates to the image processor.
    Returns:
      desired accuracy in no particular order, or an empty array if none.
    See Also:
      - `ImageProcessor​.getPositionalAccuracyHints()`

  - ### setPositionalAccuracyHints

    public void setPositionalAccuracyHints(Quantity<?>... hints)
    Sets hints about desired positional accuracy, in "real world" units or in pixel units. The default implementation delegates to the image processor.
    Parameters:
      `hints` - desired accuracy in no particular order, or a `null` array if none. Null elements in the array are ignored.
    See Also:
      - `ImageProcessor​.setPositionalAccuracyHints(Quantity...)`

  - ### resample

    public GridCoverage resample(GridCoverage source, GridGeometry target) throws TransformException
    Creates a new coverage with a different grid extent, resolution or coordinate reference system. The desired properties are specified by the `GridGeometry` argument, which may be incomplete. The missing grid geometry components are completed as below:

    Default values for undefined grid geometry components
    Component | Default value
    --- | ---
    Grid extent | A default size preserving resolution at source point of interest.
    Grid to CRS transform | Whatever it takes for fitting data inside the supplied extent.
    Coordinate reference system | Same as source coverage.

    The interpolation method can be specified by `setInterpolation(Interpolation)`. If the grid coverage values are themselves interpolated, this method tries to use the original data. The intent is to avoid adding interpolations on top of other interpolations.
    Parameters:
      `source` - the grid coverage to resample.
      `target` - the desired geometry of returned grid coverage. May be incomplete.
    Returns:
      a grid coverage with the characteristics specified in the given grid geometry.
    Throws:
      `IncompleteGridGeometryException` - if the source grid geometry is missing an information. It may be the source CRS, the source extent, etc. depending on context.
      `TransformException` - if some coordinates can not be transformed to the specified target.

  - ### equals

    public boolean equals(Object object)
    Returns `true` if the given object is a coverage processor of the same class with the same configuration.
    Overrides:
      `equals` in class `Object`
    Parameters:
      `object` - the other object to compare with this processor.
    Returns:
      whether the other object is a coverage processor of the same class with the same configuration.

  - ### hashCode

    public int hashCode()
    Returns a hash code value for this coverage processor based on its current configuration.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      a hash code value for this processor.

  - ### clone

    public GridCoverageProcessor clone()
    Returns a coverage processor with the same configuration than this processor.
    Overrides:
      `clone` in class `Object`
    Returns:
      a clone of this coverage processor.