Class CanvasExtent

java.lang.Object
org.apache.sis.coverage.grid.GridExtent
org.apache.sis.portrayal.CanvasExtent
All Implemented Interfaces:
Serializable, LenientComparable

final class CanvasExtent extends GridExtent
A GridExtent which remembers the Canvas.getPointOfInterest(boolean) coordinates. This class also contains static help functions for the construction of GridGeometry.
Since:
1.1
Version:
1.3
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • pointOfInterest

      private final double[] pointOfInterest
      The grid coordinates of a representative point. The CanvasExtent point of interest is the Canvas point of interest converted to (typically) pixel coordinates.
      See Also:
  • Constructor Details

    • CanvasExtent

      private CanvasExtent(org.opengis.metadata.spatial.DimensionNameType[] axisTypes, long[] lower, long[] upper, double[] pointOfInterest)
      Creates a new grid extent.
      Parameters:
      axisTypes - the type of each grid axis, or null if unspecified.
      lower - the valid minimum grid coordinates (inclusive).
      upper - the valid maximum grid coordinates (exclusive).
      pointOfInterest - the grid coordinates of a representative point.
  • Method Details

    • getPointOfInterest

      public double[] getPointOfInterest(org.opengis.referencing.datum.PixelInCell anchor)
      Returns the grid coordinates of a representative point. This is the canvas point of interest converted to (typically) pixel coordinates.
      Overrides:
      getPointOfInterest in class GridExtent
      Parameters:
      anchor - the convention to be used for conversion to "real world" coordinates.
      Returns:
      the grid coordinates of a representative point.
      See Also:
    • create

      static GridExtent create(GeneralEnvelope bounds, org.opengis.geometry.DirectPosition poi, org.opengis.metadata.spatial.DimensionNameType[] axisTypes, int agmDim)
      Creates a new grid extent from the given display bounds. All supplemental dimensions will have the [0 … 0] grid range. If a point of interest is available, its coordinates will be remembered.
      Parameters:
      bounds - bounds of the display device, typically in pixel units.
      poi - point of interest in pixel units, or null if unknown.
      axisTypes - name of display axes, or null if unknown.
      agmDim - augmented number of dimensions (i.e. including supplemental dimensions).
      Returns:
      grid extent computed from the given display bounds.
    • findSupplementalDimensions

      static long findSupplementalDimensions(org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.operation.Matrix derivative, List<org.opengis.referencing.crs.CoordinateReferenceSystem> addTo)
      Finds the dimensions in the given CRS that are not included in the objective CRS. Those dimensions are discovered by inspection of the derivative of the transform from the given CRS to the objective CRS. In addition, this method also adds the CRS component of those supplemental dimensions in the given list. If a component cannot be separated from the CRS, then current implementation excludes it from the set of supplemental dimensions.
      Parameters:
      crs - the coordinate reference system of the Point Of Interest (POI).
      derivative - derivative of the transform from Point Of Interest (POI) to objective CRS.
      addTo - the list where to add the CRS component for supplemental dimensions.
      Returns:
      a bitmask of supplemental dimensions.
      See Also:
    • createGridToCRS

      static LinearTransform createGridToCRS(org.opengis.referencing.operation.Matrix displayToObjective, org.opengis.geometry.DirectPosition pointOfInterest, long supplementalDimensions)
      Creates the "grid to CRS" transform of a grid geometry as the inverse of the "objective to display" transform augmented with supplemental dimensions.
      Parameters:
      displayToObjective - inverse of Canvas.getObjectiveToDisplay().
      pointOfInterest - value of Canvas.getPointOfInterest(boolean).
      supplementalDimensions - value of findSupplementalDimensions(CoordinateReferenceSystem, Matrix, List).
      Returns:
      the "grid to CRS" transform of a grid geometry for a Canvas.
    • suggestAxisTypes

      static org.opengis.metadata.spatial.DimensionNameType[] suggestAxisTypes(org.opengis.referencing.crs.CoordinateReferenceSystem crs, int displayDimension)
      Suggests axis types for supplemental dimensions not managed by the Canvas. Those types are only a help for debugging purpose, by providing more information to the developers. They should not be used for any "real" work.
      Parameters:
      crs - the coordinate reference system to use for inferring axis types.
      displayDimension - number of dimensions managed by the Canvas.
      Returns:
      suggested axis types. Never null, but contains null elements.
      See Also: