public class ConcatenatedTransform extends AbstractMathTransform implements Serializable
AbstractMathTransform.Inverse
Modifier and Type | Field and Description |
---|---|
MathTransform |
transform1
The first math transform.
|
MathTransform |
transform2
The second math transform.
|
SINGLE_LINE
Modifier | Constructor and Description |
---|---|
protected |
ConcatenatedTransform(MathTransform transform1,
MathTransform transform2)
Constructs a concatenated transform.
|
Modifier and Type | Method and Description |
---|---|
static MathTransform |
create(MathTransform tr1,
MathTransform tr2)
Constructs a concatenated transform.
|
Matrix |
derivative(DirectPosition point)
Gets the derivative of this transform at a point.
|
Matrix |
derivative(Point2D point)
Gets the derivative of this transform at a point.
|
boolean |
equals(Object object)
Compares the specified object with this math transform for equality.
|
protected String |
formatWKT(Formatter formatter)
Format the inner part of a Well
Known Text (WKT) element.
|
int |
getSourceDimensions()
Gets the dimension of input points.
|
int |
getStepCount()
Returns the number of math transform steps performed by this
concatenated transform.
|
int |
getTargetDimensions()
Gets the dimension of output points.
|
int |
hashCode()
Returns a hash value for this transform.
|
MathTransform |
inverse()
Creates the inverse transform of this object.
|
boolean |
isIdentity()
Tests whether this transform does not move any points.
|
DirectPosition |
transform(DirectPosition ptSrc,
DirectPosition ptDst)
Transforms the specified
ptSrc and stores the result in ptDst . |
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms a list of coordinate point ordinal values.
|
void |
transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms a list of coordinate point ordinal values.
|
createTransformedShape, ensureNonNull, getName, getParameterDescriptors, getParameterValues, needCopy, normalizeAngle, rollLongitude, transform, transform, transform
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKT
toWKT
public final MathTransform transform1
public final MathTransform transform2
protected ConcatenatedTransform(MathTransform transform1, MathTransform transform2)
create(org.opengis.referencing.operation.MathTransform, org.opengis.referencing.operation.MathTransform)
instead.transform1
- The first math transform.transform2
- The second math transform.public static MathTransform create(MathTransform tr1, MathTransform tr2)
MathTransform2D
if source and
target dimensions are equal to 2. Likewise, it will implements MathTransform1D
if
source and target dimensions are equal to 1. MathTransform
implementations are
available in two version: direct and non-direct. The "non-direct" version use an intermediate
buffer when performing transformations; they are slower and consume more memory. They are
used only as a fallback when a "direct" version can't be created.tr1
- The first math transform.tr2
- The second math transform.public final int getSourceDimensions()
getSourceDimensions
in interface MathTransform
getSourceDimensions
in class AbstractMathTransform
public final int getTargetDimensions()
getTargetDimensions
in interface MathTransform
getTargetDimensions
in class AbstractMathTransform
public final int getStepCount()
public DirectPosition transform(DirectPosition ptSrc, DirectPosition ptDst) throws TransformException
ptSrc
and stores the result in ptDst
.transform
in interface MathTransform
transform
in class AbstractMathTransform
ptSrc
- the specified coordinate point to be transformed.ptDst
- the specified coordinate point that stores the result of transforming ptSrc
, or null
.ptSrc
and storing the result in
ptDst
, or a newly created point if ptDst
was null.TransformException
- if the point can't be transformed.public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws TransformException
transform1
, then the intermediate points are transformed by transform2
.
The transformations are performed without intermediate buffer if it can be avoided.transform
in interface MathTransform
srcPts
- the array containing the source point coordinates.srcOff
- the offset to the first point to be transformed in the source array.dstPts
- the array into which the transformed point coordinates are returned. May be the
same than srcPts
.dstOff
- the offset to the location of the first transformed point that is stored in the
destination array.numPts
- the number of point objects to be transformed.TransformException
- if a point can't be transformed. Some implementations will stop at
the first failure, wile some other implementations will fill the untransformable points
with NaN values, continue and throw the exception only at end.
Implementations that fall in the later case should set the last completed transform to this
.public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws TransformException
double[]
, transformed by transform1
first, then by
transform2
and finally the result is casted to float
primitive type and
stored in the destination array. The use of double
primitive type for intermediate
results is necesssary for reducing rounding errors.transform
in interface MathTransform
transform
in class AbstractMathTransform
srcPts
- the array containing the source point coordinates.srcOff
- the offset to the first point to be transformed in the source array.dstPts
- the array into which the transformed point coordinates are returned. May be the
same than srcPts
.dstOff
- the offset to the location of the first transformed point that is stored in the
destination array.numPts
- the number of point objects to be transformed.TransformException
- if a point can't be transformed. Some implementations will stop at
the first failure, wile some other implementations will fill the untransformable points
with NaN values, continue and throw the exception only at end.
Implementations that fall in the later case should set the last completed transform to this
.public MathTransform inverse() throws NoninvertibleTransformException
inverse
in interface MathTransform
inverse
in class AbstractMathTransform
NoninvertibleTransformException
- if the transform can't be inversed.public Matrix derivative(Point2D point) throws TransformException
derivative(DirectPosition)
method because the transformation steps transform1
and
transform2
may not be instances of MathTransform2D
.derivative
in class AbstractMathTransform
point
- The coordinate point where to evaluate the derivative.TransformException
- if the derivative can't be evaluated at the specified point.MathTransform2D.derivative(Point2D)
public Matrix derivative(DirectPosition point) throws TransformException
derivative
in interface MathTransform
derivative
in class AbstractMathTransform
point
- The coordinate point where to evaluate the derivative.null
).TransformException
- if the derivative can't be evaluated at the specified point.public final boolean isIdentity()
isIdentity
in interface MathTransform
isIdentity
in class AbstractMathTransform
true
if this MathTransform
is an identity transform; false
otherwise.public final int hashCode()
hashCode
in class AbstractMathTransform
public final boolean equals(Object object)
equals
in class AbstractMathTransform
object
- The object to compare with this transform.true
if the given object is a transform of the same class and if, given
identical source position, the transformed position would be the equals.protected String formatWKT(Formatter formatter)
formatWKT
in class AbstractMathTransform
formatter
- The formatter to use.Formattable.toWKT()
,
Formattable.toString()
Copyright © 1996–2019 Geotools. All rights reserved.