Class MolodenskyFormula
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.DatumShiftTransform
org.apache.sis.referencing.operation.transform.MolodenskyFormula
- All Implemented Interfaces:
Serializable,Parameterized,LenientComparable,org.opengis.referencing.operation.MathTransform
- Direct Known Subclasses:
InterpolatedMolodenskyTransform,MolodenskyTransform
Implementation of Molodensky formulas. This class is used by:
- The "real"
MolodenskyTransform(see that class for documentation about Molodensky transform). InterpolatedMolodenskyTransform, which conceptually works on geocentric coordinates but is implemented in Apache SIS using Molodensky (never abridged) formulas for performance reasons. However, this implementation choice should be hidden to users (except by mention in javadoc).
- Since:
- 0.7
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final doubleThe value of 1/sin(1″) multiplied by the conversion factor from arc-seconds to radians (π/180)/(60⋅60).protected final doubleThe square of eccentricity of the source ellipsoid.(package private) final booleantruefor the abridged formula, orfalsefor the complete one.(package private) final booleantrueif the source coordinates have a height.(package private) final booleantrueif the target coordinates have a height.protected final doubleSemi-major axis length (a) of the source ellipsoid.private static final longSerial number for inter-operability with different versions.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.(package private) final doubleDifference in the semi-major axes of the target and source ellipsoids:Δa = target a - source a.(package private) final doubleDifference between the flattening of the target and source ellipsoids (Δf), opportunistically modified with additional terms.Fields inherited from class org.apache.sis.referencing.operation.transform.DatumShiftTransform
context, gridFields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES -
Constructor Summary
ConstructorsConstructorDescriptionMolodenskyFormula(MolodenskyFormula inverse, org.opengis.referencing.datum.Ellipsoid source, org.opengis.referencing.datum.Ellipsoid target, org.opengis.parameter.ParameterDescriptorGroup descriptor) Constructs the inverse of a Molodensky transform.MolodenskyFormula(org.opengis.referencing.datum.Ellipsoid source, boolean isSource3D, org.opengis.referencing.datum.Ellipsoid target, boolean isTarget3D, double tX, double tY, double tZ, DatumShiftGrid<?, ?> grid, boolean isAbridged, org.opengis.parameter.ParameterDescriptorGroup descriptor) Creates a Molodensky transform from the specified parameters. -
Method Summary
Modifier and TypeMethodDescription(package private) voidcompleteParameters(Parameters pg, double semiMinor, javax.measure.Unit<?> unit, double Δf) Sets parameter values in the given group for parameters other than axis lengths.protected intComputes a hash value for this transform.booleanequals(Object object, ComparisonMode mode) Compares the specified object with this math transform for equality.org.opengis.parameter.ParameterValueGroupReturns a copy of internal parameter values of this transform.final intGets the dimension of input points.final intGets the dimension of output points.(package private) final org.opengis.referencing.operation.Matrixtransform(double λ, double φ, double h, double[] dstPts, int dstOff, double tX, double tY, double tZ, double[] offset, boolean derivate) Implementation ofAbstractMathTransform.transform(double[], int, double[], int, boolean)with possibility to override some field values.Methods inherited from class org.apache.sis.referencing.operation.transform.DatumShiftTransform
ensureGeocentricTranslation, getContextualParameters, normalizedToGridX, normalizedToGridY, setContextParametersMethods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, derivative, equals, formatTo, getDomain, getParameterDescriptors, hashCode, inverse, isIdentity, isInverseEquals, mismatchedDimension, transform, transform, transform, transform, transform, transform, tryConcatenateMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.referencing.operation.MathTransform
toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
ANGULAR_SCALE
static final double ANGULAR_SCALEThe value of 1/sin(1″) multiplied by the conversion factor from arc-seconds to radians (π/180)/(60⋅60). This is the final multiplication factor for Δλ and Δφ.- See Also:
-
isSource3D
final boolean isSource3Dtrueif the source coordinates have a height. -
isTarget3D
final boolean isTarget3Dtrueif the target coordinates have a height. -
isAbridged
final boolean isAbridgedtruefor the abridged formula, orfalsefor the complete one. -
tX
protected final double tXShift along the geocentric X axis (toward prime meridian) in units of the semi-major axis of the source ellipsoid.- See Also:
-
tY
protected final double tYShift along the geocentric Y axis (toward 90°E) in units of the semi-major axis of the source ellipsoid.- See Also:
-
tZ
protected final double tZShift along the geocentric Z axis (toward north pole) in units of the semi-major axis of the source ellipsoid.- See Also:
-
Δa
final double ΔaDifference in the semi-major axes of the target and source ellipsoids:Δa = target a - source a. -
Δfmod
final double ΔfmodDifference between the flattening of the target and source ellipsoids (Δf), opportunistically modified with additional terms. The value depends on whether this Molodensky transform is abridged or not:- For Molodensky, this field is set to (b⋅Δf).
- For Abridged Molodensky, this field is set to (a⋅Δf) + (f⋅Δa).
-
semiMajor
protected final double semiMajorSemi-major axis length (a) of the source ellipsoid. -
eccentricitySquared
protected 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
-
MolodenskyFormula
MolodenskyFormula(MolodenskyFormula inverse, org.opengis.referencing.datum.Ellipsoid source, org.opengis.referencing.datum.Ellipsoid target, org.opengis.parameter.ParameterDescriptorGroup descriptor) Constructs the inverse of a Molodensky transform.- Parameters:
inverse- the transform for which to create the inverse.source- the source ellipsoid of the giveninversetransform.target- the target ellipsoid of the giveninversetransform.descriptor- the contextual parameter descriptor.
-
MolodenskyFormula
MolodenskyFormula(org.opengis.referencing.datum.Ellipsoid source, boolean isSource3D, org.opengis.referencing.datum.Ellipsoid target, boolean isTarget3D, double tX, double tY, double tZ, DatumShiftGrid<?, ?> grid, boolean isAbridged, org.opengis.parameter.ParameterDescriptorGroup descriptor) Creates a Molodensky transform from the specified parameters. If a non-nullgridis specified, it is caller's responsibility to verify its validity.- 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.tX- the geocentric X translation in same units than the source ellipsoid axes.tY- the geocentric Y translation in same units than the source ellipsoid axes.tZ- the geocentric Z translation in same units than the source ellipsoid axes.grid- interpolation grid in geocentric coordinates, ornullif none.isAbridged-truefor the abridged formula, orfalsefor the complete one.descriptor- the contextual parameter descriptor.
-
-
Method Details
-
getParameterValues
Returns 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 interfaceParameterized- Overrides:
getParameterValuesin classDatumShiftTransform- Returns:
- a copy of the internal parameter values for this transform.
- See Also:
-
completeParameters
Sets parameter values in the given group for parameters other than axis lengths. This method is invoked for both completing contextual parameters (pg == context) and for completing internal parameters (pg != context). When this method is invoked, the following parameters are already set:"src_semi_major""src_semi_minor""tgt_semi_major"(contextual parameters only)"tgt_semi_minor"(contextual parameters only)
"dim"parameter. Subclasses shall override this method for completing also the following parameters:- "X-axis translation" (Molodensky only)
- "Y-axis translation" (Molodensky only)
- "Z-axis translation" (Molodensky only)
- "Geocentric translation file" (Geocentric interpolations only)
- "Semi-major axis length difference" (Always for Molodensky, internal WKT only for geocentric interpolations)
- "Flattening difference" (Always for Molodensky, internal WKT only for geocentric interpolations)
- Parameters:
pg- where to set the parameters.semiMinor- the semi minor axis length, in unit ofunit.unit- the unit of measurement to declare.\u0394f- the flattening difference to set, or NaN if this method should fetch that value itself.
-
getSourceDimensions
public final int getSourceDimensions()Gets the dimension of input points.- Specified by:
getSourceDimensionsin interfaceorg.opengis.referencing.operation.MathTransform- Specified by:
getSourceDimensionsin classAbstractMathTransform- Returns:
- the input dimension, which is 2 or 3.
- See Also:
-
getTargetDimensions
public final int getTargetDimensions()Gets the dimension of output points.- Specified by:
getTargetDimensionsin interfaceorg.opengis.referencing.operation.MathTransform- Specified by:
getTargetDimensionsin classAbstractMathTransform- Returns:
- the output dimension, which is 2 or 3.
- See Also:
-
transform
final org.opengis.referencing.operation.Matrix transform(double λ, double φ, double h, double[] dstPts, int dstOff, double tX, double tY, double tZ, double[] offset, boolean derivate) throws org.opengis.referencing.operation.TransformException Implementation ofAbstractMathTransform.transform(double[], int, double[], int, boolean)with possibility to override some field values. In this method signature, parameters having the same name than fields have the same value, except in some special circumstances:tX,tYandtZparameters always have the values oftX,tYandtZfields when this method is invoked byMolodenskyTransform. But those values may be slightly different when this method is invoked byInterpolatedMolodenskyTransform.
- Parameters:
\u03bb- longitude (radians).\u03c6- latitude (radians).h- height above the ellipsoid in unit of semi-major axis.dstPts- the array into which the transformed coordinate is returned, ornull.dstOff- the offset to the location of the transformed point that is stored in the destination array.tX- thetXfield value (or a slightly different value during geocentric interpolation).tY- thetYfield value (or a slightly different value during geocentric interpolation).tZ- thetZfield value (or a slightly different value during geocentric interpolation).offset- an array of length 3 if this method should use the interpolation grid, ornullotherwise.derivate-truefor computing the derivative, orfalseif not needed.- Throws:
org.opengis.referencing.operation.TransformException- if a point cannot be transformed.
-
computeHashCode
protected int computeHashCode()Computes a hash value for this transform. This method is invoked byAbstractMathTransform.hashCode()when first needed.- Overrides:
computeHashCodein classDatumShiftTransform- Returns:
- the hash code value. This value may change between different execution of the Apache SIS library.
-
equals
Compares the specified object with this math transform for equality.- Specified by:
equalsin interfaceLenientComparable- Overrides:
equalsin classDatumShiftTransform- Parameters:
object- the object to compare with this transform.mode- the strictness level of the comparison. Default toSTRICT.- Returns:
trueif the given object is considered equals to this math transform.- See Also:
-