Class MatrixParameters

java.lang.Object
org.apache.sis.parameter.TensorParameters<Double>
org.apache.sis.parameter.MatrixParameters
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MatrixParametersAlphaNum

class MatrixParameters extends TensorParameters<Double>
A special case of TensorParameters restricted to the two-dimensional case. The main purpose for this class is to use the EPSG:9624 parameter names, either as alias or as primary name.
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
Note that the EPSG database contains A3, A4, A5, A6, A7, A8 and B3 parameters, but they are for polynomial transformations, not affine transformations.
Since:
0.6
Version:
0.6
  • Field Details

    • serialVersionUID

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

    • MatrixParameters

      MatrixParameters(org.opengis.parameter.ParameterDescriptor<Integer> numRow, org.opengis.parameter.ParameterDescriptor<Integer> numCol)
      Constructs a descriptors provider.
      Parameters:
      numRow - the parameter for the number of rows.
      numCol - the parameter for the number of columns.
  • Method Details

    • isEPSG

      static boolean isEPSG(int[] indices)
      Returns true if an official EPSG parameter exists for the given indices. Those parameters are "A0", "A1", "A2", "B0", "B1" and "B2".
    • indicesToAlias

      static String indicesToAlias(int[] indices)
      Returns an alias for the given indices, or null if none. The current implementation formats:
      • the first index (the matrix row) as letter, starting from 'A',
      • the second index (the matrix column) as digit, starting from '0'.
      Note that for row < 2 and column < 3, the returned aliases are the names used by the EPSG database. For other row and column indices, the same pattern is still used but the result is not an official EPSG parameter name.
      Parameters:
      indices - the indices of the tensor element for which to create a parameter alias.
      Returns:
      the parameter descriptor alias for the tensor element at the given indices, or null if none.
    • aliasToIndices

      static int[] aliasToIndices(String alias)
      Returns the indices for the given alias, or null if none. This method is the converse of indicesToAlias(int[]).
    • nameToIndices

      protected int[] nameToIndices(String name) throws IllegalArgumentException
      Returns the indices of matrix element for the given parameter name, or null if none. This implementation unconditionally checks for the alphanumeric (EPSG-like) name first since this is a very quick check. If the given name does not use the EPSG syntax, then this method fallback on the WKT1 syntax.
      Overrides:
      nameToIndices in class TensorParameters<Double>
      Parameters:
      name - the parameter name to parse.
      Returns:
      indices of the tensor element of the given name, or null if the name is not recognized.
      Throws:
      IllegalArgumentException - if the name has been recognized but an error occurred while parsing it (e.g. an NumberFormatException, which is an IllegalArgumentException subclass).
    • createElementDescriptor

      protected org.opengis.parameter.ParameterDescriptor<Double> createElementDescriptor(int[] indices) throws IllegalArgumentException
      Creates a new parameter descriptor for a matrix element at the given indices. This method creates:
      • The OGC name (e.g. "elt_1_2") as primary name.
      • The alpha-numeric name (e.g. "B2") as an alias.
      This method does not assign the alpha-numeric names to the EPSG authority in order to avoid confusion when formatting the parameters as Well Known Text (WKT). However, MatrixParametersAlphaNum subclass will assign some names to the EPSG authority, as well as their identifier (e.g. EPSG:8641).
      Overrides:
      createElementDescriptor in class TensorParameters<Double>
      Parameters:
      indices - the indices of the tensor element for which to create a parameter.
      Returns:
      the parameter descriptor for the given tensor element.
      Throws:
      IllegalArgumentException - if the given array does not have the expected length or have illegal value.
      See Also:
    • readResolve

      Object readResolve() throws ObjectStreamException
      On deserialization, replaces the deserialized instance by the unique instance if possible.
      Throws:
      ObjectStreamException