|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFormattableObject
AbstractMathTransform
PassThroughTransform
@Immutable public class PassThroughTransform
Transform which passes through a subset of ordinates to another transform.
This allows transforms to operate on a subset of ordinates. For example giving
(latitude, longitude, height) coordinates,
PassThroughTransform can convert the height values from feet to
meters without affecting the latitude and longitude values.
DimensionFilter,
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 | |
|---|---|
protected int |
firstAffectedOrdinate
Index of the first affected ordinate. |
protected int |
numTrailingOrdinates
Number of unaffected ordinates after the affected ones. |
protected MathTransform |
subTransform
The sub transform. |
| Fields inherited from class FormattableObject |
|---|
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE |
| Constructor Summary | |
|---|---|
protected |
PassThroughTransform(int firstAffectedOrdinate,
MathTransform subTransform,
int numTrailingOrdinates)
Creates a pass through transform. |
| Method Summary | |
|---|---|
protected int |
computeHashCode()
Computes a hash value for this transform. |
static MathTransform |
create(int firstAffectedOrdinate,
MathTransform subTransform,
int numTrailingOrdinates)
Creates a transform which passes through a subset of ordinates to another transform. |
Matrix |
derivative(DirectPosition 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. |
int[] |
getModifiedCoordinates()
Ordered sequence of positive integers defining the positions in a coordinate tuple of the coordinates affected by this pass-through transform. |
int |
getSourceDimensions()
Gets the dimension of input points. |
MathTransform |
getSubTransform()
Returns the sub transform. |
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. |
protected void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
Transforms a single coordinate 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, derivative, ensureNonNull, equals, getName, getParameterDescriptors, getParameterValues, hashCode, rollLongitude, transform, 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 |
|---|
protected final int firstAffectedOrdinate
protected final int numTrailingOrdinates
protected final MathTransform subTransform
getSubTransform()| Constructor Detail |
|---|
protected PassThroughTransform(int firstAffectedOrdinate,
MathTransform subTransform,
int numTrailingOrdinates)
firstAffectedOrdinate - Index of the first affected ordinate.subTransform - The sub transform.numTrailingOrdinates - Number of trailing ordinates to pass through.create(int, org.opengis.referencing.operation.MathTransform, int)| Method Detail |
|---|
public static MathTransform create(int firstAffectedOrdinate,
MathTransform subTransform,
int numTrailingOrdinates)
Affected ordinates will range fromSource: firstAffectedOrdinate + subTransform.getSourceDimensions() + numTrailingOrdinates Target: firstAffectedOrdinate + subTransform.getTargetDimensions() + numTrailingOrdinates
firstAffectedOrdinate inclusive to
dimTarget - numTrailingOrdinates exclusive.
firstAffectedOrdinate - Index of the first affected ordinate.subTransform - The sub transform.numTrailingOrdinates - Number of trailing ordinates to pass through.
public final MathTransform getSubTransform()
public final int[] getModifiedCoordinates()
public final int getSourceDimensions()
getSourceDimensions in interface MathTransformgetSourceDimensions in class AbstractMathTransformpublic final int getTargetDimensions()
getTargetDimensions in interface MathTransformgetTargetDimensions in class AbstractMathTransformpublic boolean isIdentity()
isIdentity in interface MathTransformisIdentity in class AbstractMathTransform
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 the sub-transform failed.
public void transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
throws TransformException
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 the sub-transform failed.
public void transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
throws TransformException
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 the sub-transform failed.
public void transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
throws TransformException
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 the sub-transform failed.
public void transform(float[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
throws TransformException
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 the sub-transform failed.
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 MathTransform inverse()
throws NoninvertibleTransformException
inverse in interface MathTransforminverse in class AbstractMathTransformNoninvertibleTransformExceptionprotected int computeHashCode()
AbstractMathTransform.hashCode()
when first needed.
computeHashCode in class AbstractMathTransform
public 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.
"PASSTHROUGH_MT".FormattableObject.toWKT(),
FormattableObject.toString()numTrailingOrdinates parameter is not part of OpenGIS specification.
We should returns a more complex WKT when numTrailingOrdinates != 0,
using an affine transform to change the coordinates order.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||