Class InterpolatedMolodenskyTransform
Object
FormattableObject
AbstractMathTransform
DatumShiftTransform
InterpolatedMolodenskyTransform
- All Implemented Interfaces:
- Serializable,- Parameterized,- LenientComparable,- MathTransform
Transforms between two geographic CRS by performing geocentric translations interpolated from a grid file, but using
 Molodensky approximation. This transformation is conceptually defined as a translation in geocentric coordinates
 as performed by 
InterpolatedGeocentricTransform, but uses the Molodensy
 (non-abridged) approximation for performance reasons.
 Errors are less than 3 centimetres for the "France geocentric interpolation" (ESPG:9655).
 By comparison, the finest accuracy reported in the grid file for France is 5 centimetres.
 Algorithm
This class transforms two- or three- dimensional coordinates from a geographic CRS to another geographic CRS. The changes between source and target coordinates are small (usually less than 400 metres), but vary for every position. Those changes are provided in a datum shift grid, usually loaded from one or two files.Many datum shift grids like NADCON and NTv2 apply the interpolated translations directly on geographic coordinates.
 This relatively simple case is handled by InterpolatedTransform.
 But in the InterpolatedMolodenskyTransform case, the interpolated translations are rather the
 (tX, tY, tZ) parameters of a Molodensky transformation.
- Since:
- 0.7
- See Also:
Defined in the sis-referencing module
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final doubleThe square of eccentricity of the source ellipsoid.protected final doubleSemi-major axis length (a) of the source ellipsoid.protected final doubleShift along the geocentric X axis (toward prime meridian) in units of the semi-major axis of the source ellipsoid.protected final doubleShift along the geocentric Y axis (toward 90°E) in units of the semi-major axis of the source ellipsoid.protected final doubleShift along the geocentric Z axis (toward north pole) in units of the semi-major axis of the source ellipsoid.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedInterpolatedMolodenskyTransform(Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) Creates a transform from the specified parameters.
- 
Method SummaryModifier and TypeMethodDescriptionprotected intComputes a hash value for this transform.static MathTransformcreateGeodeticTransformation(MathTransformFactory factory, Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) Creates a transformation between two geographic CRS.booleanequals(Object object, ComparisonMode mode) Compares the specified object with this math transform for equality.Returns a description of the internal parameters of thisInterpolatedMolodenskyTransformtransform.Returns a copy of internal parameter values of this transform.final intGets the dimension of input points.final intGets the dimension of output points.inverse()Returns the inverse of this interpolated Molodensky transform.transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS, and optionally returns the derivative at that location.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS.Methods inherited from class DatumShiftTransformgetContextualParametersMethods inherited from class AbstractMathTransformderivative, equals, formatTo, getDomain, hashCode, isIdentity, transform, transform, transform, transform, tryConcatenateMethods inherited from class FormattableObjectprint, toString, toString, toWKTMethods inherited from class Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface MathTransformtoWKT
- 
Field Details- 
tXprotected final double tXShift along the geocentric X axis (toward prime meridian) in units of the semi-major axis of the source ellipsoid.- See Also:
 
- 
tYprotected final double tYShift along the geocentric Y axis (toward 90°E) in units of the semi-major axis of the source ellipsoid.- See Also:
 
- 
tZprotected final double tZShift along the geocentric Z axis (toward north pole) in units of the semi-major axis of the source ellipsoid.- See Also:
 
- 
semiMajorprotected final double semiMajorSemi-major axis length (a) of the source ellipsoid.
- 
eccentricitySquaredprotected final double eccentricitySquaredThe square of eccentricity of the source ellipsoid. This can be computed by ℯ² = (a²-b²)/a² where a is the semi-major axis length and b is the semi-minor axis length.
 
- 
- 
Constructor Details- 
InterpolatedMolodenskyTransformprotected InterpolatedMolodenskyTransform(Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) Creates a transform from the specified parameters. ThisInterpolatedMolodenskyTransformclass expects coordinate values in the following order and units:- longitudes in radians relative to the prime meridian (usually Greenwich),
- latitudes in radians,
- optionally heights above the ellipsoid, in same units than the source ellipsoid axes.
 InterpolatedMolodenskyTransforminstances need to be concatenated with the following affine transforms:- Normalization before InterpolatedMolodenskyTransform:- Conversion of (λ,φ) from degrees to radians.
 
- Denormalization after InterpolatedMolodenskyTransform:- Conversion of (λ,φ) from radians to degrees.
 
 InterpolatedMolodenskyTransformconstruction, the full conversion chain including the above affine transforms can be created byDatumShiftTransform.getContextualParameters().completeTransform(factory, this)}.- Parameters:
- source- the source ellipsoid.
- isSource3D-- trueif the source coordinates have a height.
- target- the target ellipsoid.
- isTarget3D-- trueif the target coordinates have a height.
- grid- the grid of datum shifts from source to target datum. The- DatumShiftGrid.interpolateInCell(…)method shall compute (ΔX, ΔY, ΔZ) translations from source to target in the unit of source ellipsoid axes.
- See Also:
 
 
- 
- 
Method Details- 
createGeodeticTransformationpublic static MathTransform createGeodeticTransformation(MathTransformFactory factory, Ellipsoid source, boolean isSource3D, Ellipsoid target, boolean isTarget3D, DatumShiftGrid<Angle, Length> grid) throws FactoryExceptionCreates a transformation between two geographic CRS. This factory method combines theInterpolatedMolodenskyTransforminstance with the steps needed for converting values between degrees to radians. The transform works with input and output coordinates in the following units:- longitudes in degrees relative to the prime meridian (usually Greenwich),
- latitudes in degrees,
- optionally heights above the ellipsoid, in same units than the source ellipsoids axes.
 gridinstance shall expect geographic coordinates (λ,φ) in radians.- Parameters:
- factory- the factory to use for creating the transform.
- source- the source ellipsoid.
- isSource3D-- trueif the source coordinates have a height.
- target- the target ellipsoid.
- isTarget3D-- trueif the target coordinates have a height.
- grid- the grid of datum shifts from source to target datum. The- DatumShiftGrid.interpolateInCell(…)method shall compute (ΔX, ΔY, ΔZ) translations from source to target in the unit of source ellipsoid axes.
- Returns:
- the transformation between geographic coordinates in degrees.
- Throws:
- FactoryException- if an error occurred while creating a transform.
 
- 
transformpublic Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws TransformException Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS, and optionally returns the derivative at that location.- Specified by:
- transformin class- AbstractMathTransform
- Parameters:
- srcPts- the array containing the source coordinates (cannot be- null).
- srcOff- the offset to the point to be transformed in the source array.
- dstPts- the array into which the transformed coordinates is returned. May be the same than- srcPts. May be- nullif only the derivative matrix is desired.
- dstOff- the offset to the location of the transformed point that is stored in the destination array.
- derivate-- truefor computing the derivative, or- falseif not needed.
- Returns:
- the matrix of the transform derivative at the given source position,
         or nullif thederivateargument isfalse.
- Throws:
- TransformException- if the point cannot be transformed or if a problem occurred while calculating the derivative.
- See Also:
 
- 
transformpublic void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws TransformException Transforms the (λ,φ) or (λ,φ,h) coordinates between two geographic CRS. This method performs the same work than the abovetransform(…)method, but on an arbitrary number of coordinate tuples and without computing derivative.- Specified by:
- transformin interface- MathTransform
- Overrides:
- transformin 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.
- Throws:
- TransformException- if a point cannot be transformed.
 
- 
inverseReturns the inverse of this interpolated Molodensky transform. The source ellipsoid of the returned transform will be the target ellipsoid of this transform, and conversely.- Specified by:
- inversein interface- MathTransform
- Overrides:
- inversein class- AbstractMathTransform
- Returns:
- a transform from the target ellipsoid to the source ellipsoid of this transform.
 
- 
getParameterDescriptorsReturns a description of the internal parameters of thisInterpolatedMolodenskyTransformtransform. The returned group contains parameters for the source ellipsoid semi-axis lengths and the differences between source and target ellipsoid parameters.Note: this method is mostly for debugging purposes since the isolation of non-linear parameters in this class is highly implementation dependent. Most GIS applications will instead be interested in the contextual parameters.- Specified by:
- getParameterDescriptorsin interface- Parameterized
- Overrides:
- getParameterDescriptorsin class- AbstractMathTransform
- Returns:
- a description of the internal parameters.
- See Also:
 
- 
getParameterValuesReturns a copy of internal parameter values of this transform. The returned group contains parameters for the source ellipsoid semi-axis lengths and the differences between source and target ellipsoid parameters.Note: this method is mostly for debugging purposes since the isolation of non-linear parameters in this class is highly implementation dependent. Most GIS applications will instead be interested in the contextual parameters.- Specified by:
- getParameterValuesin interface- Parameterized
- Overrides:
- getParameterValuesin class- DatumShiftTransform
- Returns:
- a copy of the internal parameter values for this transform.
- See Also:
 
- 
getSourceDimensionspublic final int getSourceDimensions()Gets the dimension of input points.- Specified by:
- getSourceDimensionsin interface- MathTransform
- Specified by:
- getSourceDimensionsin class- AbstractMathTransform
- Returns:
- the input dimension, which is 2 or 3.
- See Also:
 
- 
getTargetDimensionspublic final int getTargetDimensions()Gets the dimension of output points.- Specified by:
- getTargetDimensionsin interface- MathTransform
- Specified by:
- getTargetDimensionsin class- AbstractMathTransform
- Returns:
- the output dimension, which is 2 or 3.
- See Also:
 
- 
computeHashCodeprotected int computeHashCode()Computes a hash value for this transform. This method is invoked byAbstractMathTransform.hashCode()when first needed.- Overrides:
- computeHashCodein class- DatumShiftTransform
- Returns:
- the hash code value. This value may change between different execution of the Apache SIS library.
 
- 
equalsCompares the specified object with this math transform for equality.- Specified by:
- equalsin interface- LenientComparable
- Overrides:
- equalsin class- DatumShiftTransform
- Parameters:
- object- the object to compare with this transform.
- mode- the strictness level of the comparison. Default to- STRICT.
- Returns:
- trueif the given object is considered equals to this math transform.
- See Also:
 
 
-