All Implemented Interfaces:
Serializable, Formattable, MathTransformProvider, Deprecable, LenientComparable, org.opengis.referencing.IdentifiedObject, org.opengis.referencing.operation.OperationMethod

public final class Affine extends AbstractProvider
The provider for "Affine parametric transformation" (EPSG:9624). The set of available parameters depends on the matrix size, which is 3×3 by default.
Affine parameters
EPSG codeEPSG nameOGC nameDefault value
num_row 3
num_col 3
8623 A0 elt_0_0 1
8624 A1 elt_0_1 0
8625 A2 elt_0_2 0
8639 B0 elt_1_0 0
8640 B1 elt_1_1 1
8641 B2 elt_1_2 0
elt_2_0 0
elt_2_1 0
elt_2_2 1
Since:
0.5
Version:
1.1
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serial number for inter-operability with different versions.
      See Also:
    • NAME

      public static final String NAME
      The operation method name as defined in the EPSG database. Must matches exactly the EPSG name (this will be verified by JUnit tests).

      Note: in contrast, the name used by OGC is just "Affine".

      See Also:
    • EPSG_METHOD

      private static volatile Affine EPSG_METHOD
      The EPSG:9624 compliant instance, created when first needed.
    • EPSG_DIMENSION

      public static final int EPSG_DIMENSION
      The number of dimensions used by the EPSG:9624 definition. This will be used as the default number of dimensions. Operation methods of other dimensions, where we have no EPSG definition, shall use the Well Known Text (WKT) parameter names.
      See Also:
    • MAX_CACHED_DIMENSION

      private static final int MAX_CACHED_DIMENSION
      The maximal number of dimensions to be cached. Descriptors having more than this amount of dimensions will be recreated every time they are requested.
      See Also:
    • cached

      private static final Affine[] cached
      Cached providers for methods of dimension 1×1 to MAX_CACHED_DIMENSION. The index of each element is computed by cacheIndex(int, int). All usages of this array shall be synchronized on cached.
    • IDENTIFICATION_EPSG

      private static final Map<String,?> IDENTIFICATION_EPSG
      A map containing identification properties for creating OperationMethod or ParameterDescriptorGroup instances.
    • IDENTIFICATION_OGC

      private static final Map<String,?> IDENTIFICATION_OGC
      A map containing identification properties for creating OperationMethod or ParameterDescriptorGroup instances.
  • Constructor Details

    • Affine

      public Affine()
      Creates a provider for affine transform with a default matrix size (standard EPSG:9624 instance). This constructor is public for the needs of ServiceLoader — do not invoke explicitly. If an instance of Affine() is desired, invoke getProvider(EPSG_DIMENSION, EPSG_DIMENSION) instead.
      See Also:
    • Affine

      private Affine(int sourceDimensions, int targetDimensions)
      Creates a provider for affine transform with the specified dimensions. This is created when first needed by getProvider(int, int, boolean).
      See Also:
  • Method Details

    • inverse

      public AbstractProvider inverse()
      The inverse of this operation can be described by the same operation with different parameter values.
      Overrides:
      inverse in class AbstractProvider
      Returns:
      this for all Affine.
      See Also:
    • createMathTransform

      public org.opengis.referencing.operation.MathTransform createMathTransform(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup values) throws org.opengis.parameter.ParameterNotFoundException
      Creates a projective transform from the specified group of parameter values.
      Parameters:
      factory - ignored (can be null).
      values - the group of parameter values.
      Returns:
      the created math transform.
      Throws:
      org.opengis.parameter.ParameterNotFoundException - if a required parameter was not found.
    • redimension

      @Deprecated public org.opengis.referencing.operation.OperationMethod redimension(int sourceDimensions, int targetDimensions)
      Deprecated.
      ISO 19111:2019 removed source/target dimensions attributes.
      Returns the same operation method, but for different dimensions.
      Overrides:
      redimension in class DefaultOperationMethod
      Parameters:
      sourceDimensions - the desired number of input dimensions.
      targetDimensions - the desired number of output dimensions.
      Returns:
      the redimensioned operation method, or this if no change is needed.
    • cacheIndex

      private static int cacheIndex(int sourceDimensions, int targetDimensions)
      Returns the index where to store a method of the given dimensions in the cached array, or -1 if it should not be cached.
    • getProvider

      public static Affine getProvider(int sourceDimensions, int targetDimensions, boolean isAffine)
      Returns the operation method for the specified source and target dimensions. This method provides different Affine instances for different dimensions.
      Parameters:
      sourceDimensions - the number of source dimensions.
      targetDimensions - the number of target dimensions.
      isAffine - true if the transform is affine.
      Returns:
      the provider for transforms of the given source and target dimensions.
    • identity

      public static org.opengis.parameter.ParameterValueGroup identity(int dimension)
      Returns parameter values for an identity transform of the given input and output dimensions. Callers can modify the returned parameters if desired.
      Parameters:
      dimension - the number of source and target dimensions.
      Returns:
      parameters for an identity transform of the given dimensions.
      Since:
      0.8
    • parameters

      public static org.opengis.parameter.ParameterValueGroup parameters(org.opengis.referencing.operation.Matrix matrix)
      Returns the parameter values for the given matrix. This method is invoked by implementations of AbstractMathTransform.getParameterValues().
      Parameters:
      matrix - the matrix for which to get parameter values.
      Returns:
      the parameters of the given matrix.