Package org.apache.sis.parameter
Class MatrixParameters
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MatrixParametersAlphaNum
A special case of
Note that the EPSG database contains A3, A4, A5, A6, A7, A8 and B3 parameters,
but they are for polynomial transformations, not affine transformations.
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.
EPSG code | EPSG name | OGC name | Default 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.6
- Version:
- 0.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.parameter.TensorParameters
ALPHANUM, CACHE_SIZE, prefix, separator, WKT1
-
Constructor Summary
ConstructorsConstructorDescriptionMatrixParameters
(org.opengis.parameter.ParameterDescriptor<Integer> numRow, org.opengis.parameter.ParameterDescriptor<Integer> numCol) Constructs a descriptors provider. -
Method Summary
Modifier and TypeMethodDescription(package private) static int[]
aliasToIndices
(String alias) Returns the indices for the given alias, ornull
if none.protected org.opengis.parameter.ParameterDescriptor
<Double> createElementDescriptor
(int[] indices) Creates a new parameter descriptor for a matrix element at the given indices.(package private) static String
indicesToAlias
(int[] indices) Returns an alias for the given indices, ornull
if none.(package private) static boolean
isEPSG
(int[] indices) Returnstrue
if an official EPSG parameter exists for the given indices.protected int[]
nameToIndices
(String name) Returns the indices of matrix element for the given parameter name, ornull
if none.(package private) Object
On deserialization, replaces the deserialized instance by the unique instance if possible.Methods inherited from class org.apache.sis.parameter.TensorParameters
createValueGroup, createValueGroup, descriptor, equals, getAllDescriptors, getDefaultValue, getDimensionDescriptor, getElementDescriptor, getElementType, hashCode, indicesToName, isInBounds, rank, toMatrix
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
Method Details
-
isEPSG
static boolean isEPSG(int[] indices) Returnstrue
if an official EPSG parameter exists for the given indices. Those parameters are"A0"
,"A1"
,"A2"
,"B0"
,"B1"
and"B2"
. -
indicesToAlias
Returns an alias for the given indices, ornull
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'
.
- 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.
- the first index (the matrix row) as letter, starting from
-
aliasToIndices
Returns the indices for the given alias, ornull
if none. This method is the converse ofindicesToAlias(int[])
. -
nameToIndices
Returns the indices of matrix element for the given parameter name, ornull
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 classTensorParameters<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. anNumberFormatException
, which is anIllegalArgumentException
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.
MatrixParametersAlphaNum
subclass will assign some names to the EPSG authority, as well as their identifier (e.g. EPSG:8641).- Overrides:
createElementDescriptor
in classTensorParameters<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:
- The OGC name (e.g.
-
readResolve
On deserialization, replaces the deserialized instance by the unique instance if possible.- Throws:
ObjectStreamException
-