Package org.apache.sis.internal.coverage
Class CompoundTransform
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.internal.coverage.CompoundTransform
- All Implemented Interfaces:
Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
- Direct Known Subclasses:
CompoundTransformOf1D
,RepeatedTransform
A transform composed of an arbitrary number of juxtaposed transforms.
This implementation is sufficient for
sis-feature
purposes, but incomplete for sis-referencing
purposes. See SIS-498.- Since:
- 1.1
- Version:
- 1.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.referencing.operation.MathTransform
The inverse, created when first needed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract org.opengis.referencing.operation.MathTransform[]
Returns the component transforms that are juxtaposed in this compound transform.protected final int
Computes a hash value for this transform.static org.opengis.referencing.operation.MathTransform
create
(org.opengis.referencing.operation.MathTransform[] components) Creates a new transform made of the given components.final boolean
equals
(Object object, ComparisonMode mode) Compares the specified object with this math transform for equality.int
Returns the number of source dimensions of this compound transform.int
Returns the number of target dimensions of this compound transform.final org.opengis.referencing.operation.MathTransform
inverse()
Returns the inverse transform of this transform.boolean
Tests whether this transform does not move any points.protected final org.opengis.referencing.operation.MathTransform
tryConcatenate
(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) Concatenates or pre-concatenates in an optimized way this math transform with the given one, if possible.Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
derivative, equals, formatTo, getContextualParameters, getDomain, getParameterDescriptors, getParameterValues, hashCode, transform, transform, transform, transform, transform, transform
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.operation.MathTransform
toWKT
-
Field Details
-
inverse
private transient org.opengis.referencing.operation.MathTransform inverseThe inverse, created when first needed.
-
-
Constructor Details
-
CompoundTransform
CompoundTransform()Creates a new compound transforms.
-
-
Method Details
-
components
abstract org.opengis.referencing.operation.MathTransform[] components()Returns the component transforms that are juxtaposed in this compound transform. This method may return a direct reference to an internal array; callers shall not modify that array. -
create
public static org.opengis.referencing.operation.MathTransform create(org.opengis.referencing.operation.MathTransform[] components) Creates a new transform made of the given components.- Parameters:
components
- transforms to juxtapose for defining a new transform.- Returns:
- compound transforms with the given components.
-
getSourceDimensions
public int getSourceDimensions()Returns the number of source dimensions of this compound transform. This is the sum of the number of source dimensions of all components.- Specified by:
getSourceDimensions
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
getSourceDimensions
in classAbstractMathTransform
- Returns:
- the number of dimensions of input points.
- See Also:
-
getTargetDimensions
public int getTargetDimensions()Returns the number of target dimensions of this compound transform. This is the sum of the number of target dimensions of all components.- Specified by:
getTargetDimensions
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
getTargetDimensions
in classAbstractMathTransform
- Returns:
- the number of dimensions of output points.
- See Also:
-
isIdentity
public boolean isIdentity()Tests whether this transform does not move any points.- Specified by:
isIdentity
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
isIdentity
in classAbstractMathTransform
- Returns:
true
if all transform components are identity.
-
inverse
public final org.opengis.referencing.operation.MathTransform inverse() throws org.opengis.referencing.operation.NoninvertibleTransformExceptionReturns the inverse transform of this transform.- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
inverse
in classAbstractMathTransform
- Returns:
- the inverse of this transform.
- Throws:
org.opengis.referencing.operation.NoninvertibleTransformException
- if at least one component transform cannot be inverted.
-
tryConcatenate
protected final org.opengis.referencing.operation.MathTransform tryConcatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) throws org.opengis.util.FactoryException Concatenates or pre-concatenates in an optimized way this math transform with the given one, if possible.- Overrides:
tryConcatenate
in classAbstractMathTransform
- Parameters:
applyOtherFirst
-true
if the transformation order isother
followed bythis
, orfalse
if the transformation order isthis
followed byother
.other
- the other math transform to (pre-)concatenate with this transform.factory
- the factory which is (indirectly) invoking this method, ornull
if none.- Returns:
- the math transforms combined in an optimized way, or
null
if no such optimization is available. - Throws:
org.opengis.util.FactoryException
- if an error occurred while combining the transforms.- See Also:
-
computeHashCode
protected final int computeHashCode()Computes a hash value for this transform. This method is invoked byAbstractMathTransform.hashCode()
when first needed.- Overrides:
computeHashCode
in classAbstractMathTransform
- Returns:
- the hash code value. This value may change between different execution of the Apache SIS library.
-
equals
Compares the specified object with this math transform for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractMathTransform
- Parameters:
object
- the object to compare with this transform.mode
- the strictness level of the comparison. Default toSTRICT
.- Returns:
true
if the given object is considered equals to this math transform.- See Also:
-