Class MathTransformsOrFactory
java.lang.Object
org.apache.sis.internal.referencing.MathTransformsOrFactory
- Direct Known Subclasses:
MathTransformsOrFactory.Specified
Proxy to
MathTransforms method which can be redirected to a MathTransformFactory.
The method signature in this class mirrors the one in MathTransforms. We do not provide
this functionality as a MathTransformFactory implementation because we do not override
all methods.- Since:
- 1.0
- Version:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classAMathTransformsOrFactoryimplementation which delegate method calls to aMathTransformFactoryspecified by the user. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final MathTransformsOrFactoryThe unique instance to use when noMathTransformFactoryis specified. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDo not allow instantiation of this class, except the inner sub-class. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.opengis.referencing.operation.MathTransformconcatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform tr, org.opengis.referencing.operation.MathTransform other) Concatenates the two given transforms, switching their order ifapplyOtherFirstistrue.org.opengis.referencing.operation.MathTransformconcatenate(org.opengis.referencing.operation.MathTransform tr1, org.opengis.referencing.operation.MathTransform tr2) Concatenates the two given transforms.org.opengis.referencing.operation.MathTransformlinear(org.opengis.referencing.operation.Matrix matrix) Creates an arbitrary linear transform from the specified matrix.org.opengis.referencing.operation.MathTransformpassThrough(int firstAffectedCoordinate, org.opengis.referencing.operation.MathTransform subTransform, int numTrailingCoordinates) Creates a transform which passes through a subset of coordinates to another transform.static MathTransformsOrFactorywrap(org.opengis.referencing.operation.MathTransformFactory factory) Returns the instance to use for the given factory.
-
Field Details
-
INSTANCE
The unique instance to use when noMathTransformFactoryis specified.
-
-
Constructor Details
-
MathTransformsOrFactory
private MathTransformsOrFactory()Do not allow instantiation of this class, except the inner sub-class.
-
-
Method Details
-
wrap
public static MathTransformsOrFactory wrap(org.opengis.referencing.operation.MathTransformFactory factory) Returns the instance to use for the given factory.- Parameters:
factory- the factory, which may benull.- Returns:
- the instance to use.
-
linear
public org.opengis.referencing.operation.MathTransform linear(org.opengis.referencing.operation.Matrix matrix) throws org.opengis.util.FactoryException Creates an arbitrary linear transform from the specified matrix.- Parameters:
matrix- the matrix used to define the linear transform.- Returns:
- the linear (usually affine) transform.
- Throws:
org.opengis.util.FactoryException- if a factory is wrapped and cannot perform the operation.
-
passThrough
public org.opengis.referencing.operation.MathTransform passThrough(int firstAffectedCoordinate, org.opengis.referencing.operation.MathTransform subTransform, int numTrailingCoordinates) throws org.opengis.util.FactoryException Creates a transform which passes through a subset of coordinates to another transform.- Parameters:
firstAffectedCoordinate- index of the first affected coordinate.subTransform- the sub-transform to apply on modified coordinates.numTrailingCoordinates- number of trailing coordinates to pass through.- Returns:
- a pass-through transform, potentially as a
PassThroughTransforminstance but not necessarily. - Throws:
org.opengis.util.FactoryException- if a factory is wrapped and cannot perform the operation.
-
concatenate
public org.opengis.referencing.operation.MathTransform concatenate(org.opengis.referencing.operation.MathTransform tr1, org.opengis.referencing.operation.MathTransform tr2) throws org.opengis.util.FactoryException Concatenates the two given transforms.- Parameters:
tr1- the first math transform.tr2- the second math transform.- Returns:
- the concatenated transform.
- Throws:
org.opengis.util.FactoryException- if a factory is wrapped and cannot perform the operation.
-
concatenate
public final org.opengis.referencing.operation.MathTransform concatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform tr, org.opengis.referencing.operation.MathTransform other) throws org.opengis.util.FactoryException Concatenates the two given transforms, switching their order ifapplyOtherFirstistrue.- Parameters:
tr- the first math transform.other- the second math transform.applyOtherFirst- whetherothershould be first in the concatenation chain.- Returns:
- the concatenated transform.
- Throws:
org.opengis.util.FactoryException- if a factory is wrapped and cannot perform the operation.
-