|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFormattableObject
AbstractMathTransform
ConcatenatedTransform
@Immutable public class ConcatenatedTransform
Base class for concatenated transforms. Instances can be created by calls to the
create(MathTransform, MathTransform) method. When possible, the above-cited
method tries to concatenate projective transforms
before to fallback on the creation of new ConcatenatedTransform instances.
Concatenated transforms are serializable if all their step transforms are serializables.
MathTransformFactory.createConcatenatedTransform(MathTransform, MathTransform),
Serialized Form
| referencing/geotk-referencing (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class AbstractMathTransform |
|---|
AbstractMathTransform.Inverse |
| Field Summary | |
|---|---|
MathTransform |
transform1
The first math transform. |
MathTransform |
transform2
The second math transform. |
| Fields inherited from class FormattableObject |
|---|
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE |
| Constructor Summary | |
|---|---|
protected |
ConcatenatedTransform(MathTransform transform1,
MathTransform transform2)
Constructs a concatenated transform. |
| Method Summary | |
|---|---|
protected int |
computeHashCode()
Computes a hash value for this transform. |
static MathTransform1D |
create(MathTransform1D tr1,
MathTransform1D tr2)
Concatenates the given one-dimensional transforms. |
static MathTransform1D |
create(MathTransform1D tr1,
MathTransform1D tr2,
MathTransform1D tr3)
Concatenates the three given one-dimensional transforms. |
static MathTransform2D |
create(MathTransform2D tr1,
MathTransform2D tr2)
Concatenates the given two-dimensional transforms. |
static MathTransform2D |
create(MathTransform2D tr1,
MathTransform2D tr2,
MathTransform2D tr3)
Concatenates the three given two-dimensional transforms. |
static MathTransform |
create(MathTransform tr1,
MathTransform tr2)
Concatenates the two given transforms. |
static MathTransform |
create(MathTransform tr1,
MathTransform tr2,
MathTransform tr3)
Concatenates the three given transforms. |
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,
ComparisonMode mode)
Compares the specified object with this math transform for equality. |
String |
formatWKT(Formatter formatter)
Formats the inner part of a Well Known Text (WKT) element. |
ParameterDescriptorGroup |
getParameterDescriptors()
Returns the parameter descriptor, or null if none. |
ParameterValueGroup |
getParameterValues()
Returns the parameter values, or null if none. |
int |
getSourceDimensions()
Gets the dimension of input points. |
int |
getStepCount()
Returns the number of single math transform steps. |
List<MathTransform> |
getSteps()
Returns all concatenated transforms. |
int |
getTargetDimensions()
Gets the dimension of output points. |
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. |
protected void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
Transforms a single coordinates in a list of ordinal values. |
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
void |
transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
void |
transform(float[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
void |
transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
| Methods inherited from class AbstractMathTransform |
|---|
createTransformedShape, ensureNonNull, equals, getName, hashCode, rollLongitude, transform |
| Methods inherited from class FormattableObject |
|---|
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface MathTransform |
|---|
toWKT |
| Field Detail |
|---|
public final MathTransform transform1
public final MathTransform transform2
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public static MathTransform create(MathTransform tr1,
MathTransform tr2)
MathTransform2D if source and
target dimensions are equal to 2. Likewise, it will implement MathTransform1D
if source and target dimensions are equal to 1. MathTransform implementations
are available in two versions: direct and non-direct. The "non-direct" versions 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 static MathTransform2D create(MathTransform2D tr1,
MathTransform2D tr2)
create(MathTransform, MathTransform) and casting the result
to a MathTransform2D instance.
tr1 - The first math transform.tr2 - The second math transform.
public static MathTransform1D create(MathTransform1D tr1,
MathTransform1D tr2)
create(MathTransform, MathTransform) and casting the result
to a MathTransform1D instance.
tr1 - The first math transform.tr2 - The second math transform.
public static MathTransform create(MathTransform tr1,
MathTransform tr2,
MathTransform tr3)
tr1 - The first math transform.tr2 - The second math transform.tr3 - The third math transform.
public static MathTransform2D create(MathTransform2D tr1,
MathTransform2D tr2,
MathTransform2D tr3)
create(MathTransform, MathTransform, MathTransform) and casting
the result to a MathTransform2D instance.
tr1 - The first math transform.tr2 - The second math transform.tr3 - The third math transform.
public static MathTransform1D create(MathTransform1D tr1,
MathTransform1D tr2,
MathTransform1D tr3)
create(MathTransform, MathTransform, MathTransform) and casting
the result to a MathTransform1D instance.
tr1 - The first math transform.tr2 - The second math transform.tr3 - The third math transform.
public final int getSourceDimensions()
getSourceDimensions in interface MathTransformgetSourceDimensions in class AbstractMathTransformpublic final int getTargetDimensions()
getTargetDimensions in interface MathTransformgetTargetDimensions in class AbstractMathTransformpublic final int getStepCount()
public final List<MathTransform> getSteps()
The size of the returned list is equals to the value returned
by getStepCount().
public ParameterDescriptorGroup getParameterDescriptors()
null if none. This method performs the
same special check than getParameterValues().
getParameterDescriptors in interface ParameterizedgetParameterDescriptors in class AbstractMathTransformnull.OperationMethod.getParameters()public ParameterValueGroup getParameterValues()
null if none. Concatenated transforms usually have
no parameters; instead the parameters of the individual components (transform1 and
transform2) need to be inspected. However map projections in Geotk are implemented as
(normalize – non-linear kernel – denormalize)
tuples. This method detects such concatenation chains in order to return the parameter values
that describe the projection as a whole.
getParameterValues in interface ParameterizedgetParameterValues in class AbstractMathTransformnull.
Since this method returns a copy of the parameter values, any change to
a value will have no effect on this math transform.SingleOperation.getParameterValues()
public DirectPosition transform(DirectPosition ptSrc,
DirectPosition ptDst)
throws TransformException
ptSrc and stores the result in ptDst.
transform in interface MathTransformtransform in class AbstractMathTransformptSrc - the coordinate point to be transformed.ptDst - the 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 transform1 or transform2 failed.
protected void transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
throws TransformException
transform in class AbstractMathTransformsrcPts - The array containing the source point coordinates.srcOff - The offset to the point to be transformed in the source array.dstPts - the array into which the transformed point coordinate are returned.
May be the same than srcPts.dstOff - The offset to the location of the transformed point that is
stored in the destination array.
TransformException - If transform1 or transform2 failed.
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 MathTransformtransform in class AbstractMathTransformsrcPts - 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 transform1 or transform2 failed.
public void transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
throws TransformException
transform1, then the intermediate points are transformed by
transform2. An intermediate buffer of type double[] for intermediate
results is used for reducing rounding errors.
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - 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 transform1 or transform2 failed.
public void transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
throws TransformException
transform1, then the intermediate points are transformed by
transform2. An intermediate buffer of type double[] for intermediate
results is used for reducing rounding errors.
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - 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.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 transform1 or transform2 failed.
public void transform(float[] 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 MathTransformtransform in class AbstractMathTransformsrcPts - 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.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 transform1 or transform2 failed.
public MathTransform inverse()
throws NoninvertibleTransformException
inverse in interface MathTransforminverse in class AbstractMathTransformNoninvertibleTransformException
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 AbstractMathTransformpoint - 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 MathTransformderivative in class AbstractMathTransformpoint - 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 MathTransformisIdentity in class AbstractMathTransformprotected int computeHashCode()
AbstractMathTransform.hashCode()
when first needed.
computeHashCode in class AbstractMathTransform
public final boolean equals(Object object,
ComparisonMode mode)
equals in interface LenientComparableequals in class AbstractMathTransformobject - The object to compare with this transform.mode - The strictness level of the comparison. Default to STRICT.
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.public String formatWKT(Formatter formatter)
formatWKT in interface FormattableformatWKT in class AbstractMathTransformformatter - The formatter to use.
"CONCAT_MT".FormattableObject.toWKT(),
FormattableObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||