Class DimensionReducer

java.lang.Object
org.apache.sis.coverage.grid.DimensionReducer

final class DimensionReducer extends Object
An helper class for reducing the number of dimensions in a grid geometry, an envelope or a position. This is used when the Area Of Interest has more dimensions than the grid geometry, in which case the transform from grid to AOI will fail if we do not discard the extra dimensions.
Since:
1.1
Version:
1.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int[]
    The dimensions to keep, or null for keeping them all.
    private org.opengis.referencing.crs.CoordinateReferenceSystem
    The CRS with only the dimensions to keep, or null if no reduction.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DimensionReducer(GridGeometry base, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
    Creates an helper which will retain only the targetCRS dimensions that are found the the base grid.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final org.opengis.geometry.DirectPosition
    apply(org.opengis.geometry.DirectPosition target)
    Applies reduction on the given position.
    (package private) final org.opengis.geometry.Envelope
    apply(org.opengis.geometry.Envelope target)
    Applies reduction on the given envelope.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dimensions

      private int[] dimensions
      The dimensions to keep, or null for keeping them all.
    • reducedCRS

      private org.opengis.referencing.crs.CoordinateReferenceSystem reducedCRS
      The CRS with only the dimensions to keep, or null if no reduction.
  • Constructor Details

    • DimensionReducer

      DimensionReducer(GridGeometry base, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) throws org.opengis.util.FactoryException
      Creates an helper which will retain only the targetCRS dimensions that are found the the base grid. This will be used by caller for creating a valid sourceCRS to targetCRS transform.
      Parameters:
      base - the grid geometry which will be derived. Cannot be null.
      targetCRS - CRS of the area or point of interest. Cannot be null.
      Throws:
      org.opengis.util.FactoryException
  • Method Details

    • apply

      final org.opengis.geometry.DirectPosition apply(org.opengis.geometry.DirectPosition target)
      Applies reduction on the given position. If the position cannot be reduced, then it is returned as-is.
    • apply

      final org.opengis.geometry.Envelope apply(org.opengis.geometry.Envelope target)
      Applies reduction on the given envelope. If the envelope cannot be reduced, then it is returned as-is.