Class GridExtentCRS

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

final class GridExtentCRS extends Object
Builder for coordinate reference system which is derived from the coverage CRS by the inverse of the "grid to CRS" transform. Those CRS describe coordinates associated to the grid extent. This class provides two factory methods:
Since:
1.0
Version:
1.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Name of the parameter specifying the way image indices are associated with the coverage data attributes.
    private static final NamedIdentifier
    Name of the coordinate systems created by this class.
    private static final org.opengis.referencing.operation.OperationMethod
    Description of "CRS to grid indices" operation method.
    private static final String
    Name of the parameter where to store the grid coverage name.
    private static final org.opengis.util.InternationalString
    Scope of usage of the CRS.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Do not allow instantiation of this class.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static String
    abbreviation(int dimension)
    Returns a default axis abbreviation for the given dimension.
    private static org.opengis.referencing.cs.CoordinateSystemAxis
    axis(org.opengis.referencing.cs.CSFactory csFactory, String name, String abbreviation, org.opengis.referencing.cs.AxisDirection direction)
    Creates a coordinate system axis of the given name.
    private static org.opengis.referencing.cs.CoordinateSystem
    createCS(int tgtDim, org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types, Locale locale)
    Creates the coordinate system for engineering CRS.
    (package private) static org.opengis.referencing.crs.DerivedCRS
    forCoverage(String name, GridGeometry gg, org.opengis.referencing.datum.PixelInCell anchor, Locale locale)
    Creates a derived CRS for the grid extent of a grid coverage.
    (package private) static org.opengis.referencing.crs.EngineeringCRS
    forExtentAlone(org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types)
    Builds the engineering coordinate reference system of a GridExtent.
    private static Map<String,?>
    Creates a properties map to give to CS, CRS or datum constructors.
    private static org.opengis.util.FactoryException
    unsupported(Locale locale, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
    Returns the exception to throw for an unsupported CRS.

    Methods inherited from class java.lang.Object

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

    • NAME_PARAM

      private static final String NAME_PARAM
      Name of the parameter where to store the grid coverage name.
      See Also:
    • ANCHOR_PARAM

      private static final String ANCHOR_PARAM
      Name of the parameter specifying the way image indices are associated with the coverage data attributes.
      See Also:
    • METHOD

      private static final org.opengis.referencing.operation.OperationMethod METHOD
      Description of "CRS to grid indices" operation method.
    • SCOPE

      private static final org.opengis.util.InternationalString SCOPE
      Scope of usage of the CRS. This is a localized text saying "Conversions from coverage CRS to grid cell indices."
    • CS_NAME

      private static final NamedIdentifier CS_NAME
      Name of the coordinate systems created by this class.
  • Constructor Details

    • GridExtentCRS

      private GridExtentCRS()
      Do not allow instantiation of this class.
  • Method Details

    • forCoverage

      static org.opengis.referencing.crs.DerivedCRS forCoverage(String name, GridGeometry gg, org.opengis.referencing.datum.PixelInCell anchor, Locale locale) throws org.opengis.util.FactoryException, org.opengis.referencing.operation.NoninvertibleTransformException
      Creates a derived CRS for the grid extent of a grid coverage.

      Limitation

      If the CRS is compound, then this method takes only the first single CRS element. This is a restriction imposed by DerivedCRS API. As a result, the returned CRS may cover only the 2 or 3 first grid dimensions.
      Parameters:
      name - name of the CRS to create.
      gg - grid geometry of the coverage.
      anchor - the cell part to map (center or corner).
      locale - locale to use for axis names, or null for default.
      Returns:
      a derived CRS for coordinates (cell indices) associated to the grid extent.
      Throws:
      org.opengis.util.FactoryException - if an error occurred during the use of CSFactory or CRSFactory.
      org.opengis.referencing.operation.NoninvertibleTransformException
    • unsupported

      private static org.opengis.util.FactoryException unsupported(Locale locale, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
      Returns the exception to throw for an unsupported CRS.
    • properties

      private static Map<String,?> properties(Object name)
      Creates a properties map to give to CS, CRS or datum constructors.
    • axis

      private static org.opengis.referencing.cs.CoordinateSystemAxis axis(org.opengis.referencing.cs.CSFactory csFactory, String name, String abbreviation, org.opengis.referencing.cs.AxisDirection direction) throws org.opengis.util.FactoryException
      Creates a coordinate system axis of the given name.
      Throws:
      org.opengis.util.FactoryException
    • abbreviation

      private static String abbreviation(int dimension)
      Returns a default axis abbreviation for the given dimension.
    • createCS

      private static org.opengis.referencing.cs.CoordinateSystem createCS(int tgtDim, org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types, Locale locale) throws org.opengis.util.FactoryException
      Creates the coordinate system for engineering CRS.
      Parameters:
      tgtDim - number of dimensions of the coordinate system to create.
      gridToCRS - matrix of the transform used for converting grid cell indices to envelope coordinates. It does not matter whether it maps pixel center or corner (translation coefficients are ignored). A null means to handle as an identity transform.
      types - the value of GridExtent.types or a default value (shall not be null).
      locale - locale to use for axis names, or null for default.
      Returns:
      coordinate system for the grid extent, or null if it cannot be inferred.
      Throws:
      org.opengis.util.FactoryException - if an error occurred during the use of CSFactory.
    • forExtentAlone

      static org.opengis.referencing.crs.EngineeringCRS forExtentAlone(org.opengis.referencing.operation.Matrix gridToCRS, org.opengis.metadata.spatial.DimensionNameType[] types) throws org.opengis.util.FactoryException
      Builds the engineering coordinate reference system of a GridExtent. This is used only in the rare cases where we need to represent an extent as an envelope. This class converts DimensionNameType codes into axis names, abbreviations and directions. It is the converse of GridExtent.typeFromAxes(CoordinateReferenceSystem, int).

      The CRS type is always engineering. We cannot create temporal CRS because we do not know the temporal datum origin.

      Parameters:
      gridToCRS - matrix of the transform used for converting grid cell indices to envelope coordinates. It does not matter whether it maps pixel center or corner (translation coefficients are ignored).
      types - the value of GridExtent.types or a default value (shall not be null).
      locale - locale to use for axis names, or null for default.
      Returns:
      CRS for the grid, or null.
      Throws:
      org.opengis.util.FactoryException - if an error occurred during the use of CSFactory or CRSFactory.
      See Also: