Class Affine
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.operation.DefaultOperationMethod
org.apache.sis.internal.referencing.provider.AbstractProvider
org.apache.sis.internal.referencing.provider.Affine
- All Implemented Interfaces:
Serializable
,Formattable
,MathTransformProvider
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.operation.OperationMethod
The provider for "Affine parametric transformation" (EPSG:9624).
The set of available parameters depends on the matrix size, which is 3×3 by default.
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.5
- Version:
- 1.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
The parameter descriptor to be returned byDefaultOperationMethod.getParameters()
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Affine[]
Cached providers for methods of dimension 1×1 toMAX_CACHED_DIMENSION
.static final int
The number of dimensions used by the EPSG:9624 definition.private static Affine
The EPSG:9624 compliant instance, created when first needed.A map containing identification properties for creatingOperationMethod
orParameterDescriptorGroup
instances.A map containing identification properties for creatingOperationMethod
orParameterDescriptorGroup
instances.private static final int
The maximal number of dimensions to be cached.static final String
The operation method name as defined in the EPSG database.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
sourceCSType, sourceOnEllipsoid, targetCSType, targetOnEllipsoid
Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface org.opengis.referencing.operation.OperationMethod
FORMULA_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
cacheIndex
(int sourceDimensions, int targetDimensions) Returns the index where to store a method of the given dimensions in thecached
array, or -1 if it should not be cached.org.opengis.referencing.operation.MathTransform
createMathTransform
(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup values) Creates a projective transform from the specified group of parameter values.static Affine
getProvider
(int sourceDimensions, int targetDimensions, boolean isAffine) Returns the operation method for the specified source and target dimensions.static org.opengis.parameter.ParameterValueGroup
identity
(int dimension) Returns parameter values for an identity transform of the given input and output dimensions.inverse()
The inverse of this operation can be described by the same operation with different parameter values.static org.opengis.parameter.ParameterValueGroup
parameters
(org.opengis.referencing.operation.Matrix matrix) Returns the parameter values for the given matrix.org.opengis.referencing.operation.OperationMethod
redimension
(int sourceDimensions, int targetDimensions) Deprecated.ISO 19111:2019 removed source/target dimensions attributes.Methods inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
addIdentifierAndLegacy, addNameAndLegacy, builder, createLatitude, createLongitude, createMandatoryLatitude, createScale, createShift, createZeroConstant, getOperationType, recoverableException, resolveAmbiguity
Methods inherited from class org.apache.sis.referencing.operation.DefaultOperationMethod
castOrCopy, computeHashCode, equals, formatTo, getFormula, getInterface, getParameters, getSourceDimensions, getTargetDimensions, redimension
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
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
The EPSG:9624 compliant instance, created when first needed. -
EPSG_DIMENSION
public static final int EPSG_DIMENSIONThe 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_DIMENSIONThe 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
Cached providers for methods of dimension 1×1 toMAX_CACHED_DIMENSION
. The index of each element is computed bycacheIndex(int, int)
. All usages of this array shall be synchronized oncached
. -
IDENTIFICATION_EPSG
A map containing identification properties for creatingOperationMethod
orParameterDescriptorGroup
instances. -
IDENTIFICATION_OGC
A map containing identification properties for creatingOperationMethod
orParameterDescriptorGroup
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 ofServiceLoader
— do not invoke explicitly. If an instance ofAffine()
is desired, invokegetProvider(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 bygetProvider(int, int, boolean)
.- See Also:
-
-
Method Details
-
inverse
The inverse of this operation can be described by the same operation with different parameter values.- Overrides:
inverse
in classAbstractProvider
- Returns:
this
for allAffine
.- 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 classDefaultOperationMethod
- 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 thecached
array, or -1 if it should not be cached. -
getProvider
Returns the operation method for the specified source and target dimensions. This method provides differentAffine
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 ofAbstractMathTransform.getParameterValues()
.- Parameters:
matrix
- the matrix for which to get parameter values.- Returns:
- the parameters of the given matrix.
-