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

Grid­Coverage­Processor is safe for concurrent use in multi-threading environment.
Since:
1.1
See Also:

Defined in the sis-feature module

  • 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:
    • 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:
    • 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:
    • 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:
    • getFillValues

      public Number[] getFillValues()
      Returns the values to use for pixels that can not be computed. The default implementation delegates to the image processor.
      Returns:
      fill values to use for pixels that can not be computed, or null for the defaults.
      Since:
      1.2
      See Also:
    • setFillValues

      public void setFillValues(Number... values)
      Sets the values to use for pixels that can not be computed. The default implementation delegates to the image processor.
      Parameters:
      values - fill values to use for pixels that can not be computed, or null for the defaults.
      Since:
      1.2
      See Also:
    • mask

      public GridCoverage mask(GridCoverage source, RegionOfInterest mask, boolean maskInside) throws TransformException
      Applies a mask defined by a region of interest (ROI). If mask­Inside is true, then all pixels inside the given ROI are set to the fill values. If mask­Inside is false, then the mask is reversed: the pixels set to fill values are the ones outside the ROI.
      Parameters:
      source - the coverage on which to apply a mask.
      mask - region (in arbitrary CRS) of the mask.
      mask­Inside - true for masking pixels inside the shape, or false for masking outside.
      Returns:
      a coverage with mask applied.
      Throws:
      Transform­Exception - if ROI coordinates can not be transformed to grid coordinates.
      Since:
      1.2
    • 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 Grid­Geometry 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 set­Interpolation(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:
      Incomplete­Grid­Geometry­Exception - if the source grid geometry is missing an information. It may be the source CRS, the source extent, etc. depending on context.
      Transform­Exception - 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:
      hash­Code 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.