org.geotoolkit.referencing.operation.transform
Class MolodenskyTransform

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by MolodenskyTransform
All Implemented Interfaces:
Serializable, Formattable, EllipsoidalTransform, Parameterized, LenientComparable, MathTransform

@Immutable
public class MolodenskyTransform
extends AbstractMathTransform
implements EllipsoidalTransform, Serializable

Two- or three-dimensional datum shift using the (potentially abridged) Molodensky transformation. The Molodensky transformation (EPSG code 9604) and the abridged Molodensky transformation (EPSG code 9605) transform two or three dimensional geographic points from one geographic coordinate reference system to another (a datum shift), using three shift parameters (delta X, delta Y, delta Z) and the difference between the semi-major axis and flattenings of the two ellipsoids.

This transformation is performed directly on geographic coordinates. See any of the following providers for a list of programmatic parameters:

References:

Since:
1.2
Version:
3.19
Author:
Rueben Schulz (UBC), Martin Desruisseaux (IRD, Geomatys), Rémi Maréchal (Geomatys)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected MolodenskyTransform(boolean abridged, double sa, double sb, boolean source3D, double ta, double tb, boolean target3D, double dx, double dy, double dz)
          Constructs a Molodensky transform from the specified parameters.
protected MolodenskyTransform(MolodenskyTransform original, boolean abridged, boolean source3D, boolean target3D)
          Creates a new transform with the same ellipsoidal and Bursa-Wolf parameters than the given transform.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this transform.
static MathTransform create(boolean abridged, double a, double b, boolean source3D, double ta, double tb, boolean target3D, double dx, double dy, double dz)
          Constructs a transform from the specified Molodensky parameters.
 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.
 MolodenskyTransform forDimensions(boolean source3D, boolean target3D)
          Returns a transform having the same ellipsoidal and Bursa-Wolf parameters than this transform, but a different number of source or target dimensions.
 ParameterDescriptorGroup getParameterDescriptors()
          Returns the parameter descriptors for this math transform.
 ParameterValueGroup getParameterValues()
          Returns the parameters for this math transform.
 int getSourceDimensions()
          Gets the dimension of input points.
 int getTargetDimensions()
          Gets the dimension of output points.
 MathTransform inverse()
          Creates the inverse transform of this object.
 boolean isAbridged()
          Returns true if this Molodensky transform uses abridged formulas instead than the complete ones.
 boolean isIdentity()
          Returns true if this transform is the identity one.
protected  void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff)
          Transforms a single coordinate point.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 void transform(float[] 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.
 
Methods inherited from class AbstractMathTransform
createTransformedShape, derivative, ensureNonNull, equals, formatWKT, getName, 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, transform
 

Constructor Detail

MolodenskyTransform

protected MolodenskyTransform(boolean abridged,
                              double sa,
                              double sb,
                              boolean source3D,
                              double ta,
                              double tb,
                              boolean target3D,
                              double dx,
                              double dy,
                              double dz)
Constructs a Molodensky transform from the specified parameters. This constructor is for subclasses only; client code should use the create static method instead.

WARNING: Current implementation expects longitude and latitude ordinates in decimal degrees, but it may be changed to radians in a future version. The static factory method will preserve the decimal degrees contract.

Parameters:
abridged - true for the abridged formula, or false for the complete one.
sa - The source semi-major axis length in meters.
sb - The source semi-minor axis length in meters.
source3D - true if the source has a height.
ta - The target semi-major axis length in meters.
tb - The target semi-minor axis length in meters.
target3D - true if the target has a height.
dx - The x translation in meters.
dy - The y translation in meters.
dz - The z translation in meters.
See Also:
create(boolean, double, double, boolean, double, double, boolean, double, double, double)

MolodenskyTransform

protected MolodenskyTransform(MolodenskyTransform original,
                              boolean abridged,
                              boolean source3D,
                              boolean target3D)
Creates a new transform with the same ellipsoidal and Bursa-Wolf parameters than the given transform. The formula (abridged or complete) and the number of dimensions can be different.

Parameters:
original - The transform to copy.
abridged - true for the abridged formula, or false for the complete one.
source3D - true if the source has a height.
target3D - true if the target has a height.
Since:
3.16
Method Detail

create

public static MathTransform create(boolean abridged,
                                   double a,
                                   double b,
                                   boolean source3D,
                                   double ta,
                                   double tb,
                                   boolean target3D,
                                   double dx,
                                   double dy,
                                   double dz)
Constructs a transform from the specified Molodensky parameters. The returned transform works on (longitude, latitude, height) coordinates where the longitudes and latitudes are in decimal degrees, and the height is optional (depending on the value of the source3D and target3D arguments).

Parameters:
abridged - true for the abridged formula, or false for the complete one.
a - The source semi-major axis length in meters.
b - The source semi-minor axis length in meters.
source3D - true if the source has a height.
ta - The target semi-major axis length in meters.
tb - The target semi-minor axis length in meters.
target3D - true if the target has a height.
dx - The x translation in meters.
dy - The y translation in meters.
dz - The z translation in meters.
Returns:
A transform for the given parameters.
Since:
3.00

getParameterDescriptors

public ParameterDescriptorGroup getParameterDescriptors()
Returns the parameter descriptors for this math transform.

Specified by:
getParameterDescriptors in interface Parameterized
Overrides:
getParameterDescriptors in class AbstractMathTransform
Returns:
The parameter descriptors for this math transform, or null.
See Also:
OperationMethod.getParameters()

getParameterValues

public ParameterValueGroup getParameterValues()
Returns the parameters for this math transform.

Specified by:
getParameterValues in interface Parameterized
Overrides:
getParameterValues in class AbstractMathTransform
Returns:
The parameters for this math transform.
See Also:
SingleOperation.getParameterValues()

forDimensions

public MolodenskyTransform forDimensions(boolean source3D,
                                         boolean target3D)
Returns a transform having the same ellipsoidal and Bursa-Wolf parameters than this transform, but a different number of source or target dimensions.

Specified by:
forDimensions in interface EllipsoidalTransform
Parameters:
source3D - true if the source coordinates have a height.
target3D - true if the target coordinates have a height.
Returns:
A transform having the requested source and target dimensions (may be this).
Since:
3.16

getSourceDimensions

public final int getSourceDimensions()
Gets the dimension of input points.

Specified by:
getSourceDimensions in interface MathTransform
Specified by:
getSourceDimensions in class AbstractMathTransform

getTargetDimensions

public final int getTargetDimensions()
Gets the dimension of output points.

Specified by:
getTargetDimensions in interface MathTransform
Specified by:
getTargetDimensions in class AbstractMathTransform

transform

protected void transform(double[] srcPts,
                         int srcOff,
                         double[] dstPts,
                         int dstOff)
Transforms a single coordinate point.

Specified by:
transform in class AbstractMathTransform
Parameters:
srcPts - 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.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
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.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
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.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
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.
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.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
Parameters:
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.
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.

derivative

public Matrix derivative(DirectPosition point)
Gets the derivative of this transform at a point.

Specified by:
derivative in interface MathTransform
Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point (never null).

isAbridged

public final boolean isAbridged()
Returns true if this Molodensky transform uses abridged formulas instead than the complete ones. This is the value of the abridged boolean argument given to the constructor.

Returns:
true if this transform uses abridged formulas.
Since:
3.16

isIdentity

public boolean isIdentity()
Returns true if this transform is the identity one. This transform is considered identity (minus rounding errors) if:

Specified by:
isIdentity in interface MathTransform
Overrides:
isIdentity in class AbstractMathTransform
Since:
2.5

inverse

public MathTransform inverse()
Creates the inverse transform of this object.

Specified by:
inverse in interface MathTransform
Overrides:
inverse in class AbstractMathTransform

computeHashCode

protected int computeHashCode()
Computes a hash value for this transform. This method is invoked by AbstractMathTransform.hashCode() when first needed.

Overrides:
computeHashCode in class AbstractMathTransform
Returns:
The hash code value. This value may change between different execution of the Geotk library.

equals

public final boolean equals(Object object,
                            ComparisonMode mode)
Compares the specified object with this math transform for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractMathTransform
Parameters:
object - The object to compare with this transform.
mode - The strictness level of the comparison. Default to STRICT.
Returns:
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.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.