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 double
The value of 1/sin(1″) multiplied by the conversion factor from arc-seconds to radians (π/180)/(60⋅60).protected final double
The square of eccentricity of the source ellipsoid.(package private) final boolean
true
for the abridged formula, orfalse
for the complete one.(package private) final boolean
true
if the source coordinates have a height.(package private) final boolean
true
if the target coordinates have a height.protected final double
Semi-major axis length (a) of the source ellipsoid.private static final long
Serial number for inter-operability with different versions.protected final double
Shift along the geocentric X axis (toward prime meridian) in units of the semi-major axis of the source ellipsoid.protected final double
Shift along the geocentric Y axis (toward 90°E) in units of the semi-major axis of the source ellipsoid.protected final double
Shift along the geocentric Z axis (toward north pole) in units of the semi-major axis of the source ellipsoid.(package private) final double
Difference in the semi-major axes of the target and source ellipsoids:Δa = target a - source a
.(package private) final double
Difference 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, grid
Fields 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) void
completeParameters
(Parameters pg, double semiMinor, javax.measure.Unit<?> unit, double Δf) Sets parameter values in the given group for parameters other than axis lengths.protected int
Computes a hash value for this transform.boolean
equals
(Object object, ComparisonMode mode) Compares the specified object with this math transform for equality.org.opengis.parameter.ParameterValueGroup
Returns a copy of internal parameter values of this transform.final int
Gets the dimension of input points.final int
Gets the dimension of output points.(package private) 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) 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, setContextParameters
Methods 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, tryConcatenate
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 isSource3Dtrue
if the source coordinates have a height. -
isTarget3D
final boolean isTarget3Dtrue
if the target coordinates have a height. -
isAbridged
final boolean isAbridgedtrue
for the abridged formula, orfalse
for 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
.- See Also:
-
Δ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.- See Also:
-
-
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 giveninverse
transform.target
- the target ellipsoid of the giveninverse
transform.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-nullgrid
is specified, it is caller's responsibility to verify its validity.- Parameters:
source
- the source ellipsoid.isSource3D
-true
if the source coordinates have a height.target
- the target ellipsoid.isTarget3D
-true
if 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, ornull
if none.isAbridged
-true
for the abridged formula, orfalse
for 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:
getParameterValues
in interfaceParameterized
- Overrides:
getParameterValues
in 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.Δf
- 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:
getSourceDimensions
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
getSourceDimensions
in 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:
getTargetDimensions
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
getTargetDimensions
in 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
,tY
andtZ
parameters always have the values oftX
,tY
andtZ
fields when this method is invoked byMolodenskyTransform
. But those values may be slightly different when this method is invoked byInterpolatedMolodenskyTransform
.
- Parameters:
λ
- longitude (radians).φ
- 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
- thetX
field value (or a slightly different value during geocentric interpolation).tY
- thetY
field value (or a slightly different value during geocentric interpolation).tZ
- thetZ
field value (or a slightly different value during geocentric interpolation).offset
- an array of length 3 if this method should use the interpolation grid, ornull
otherwise.derivate
-true
for computing the derivative, orfalse
if 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:
computeHashCode
in 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:
equals
in interfaceLenientComparable
- Overrides:
equals
in classDatumShiftTransform
- Parameters:
object
- the object to compare with this transform.mode
- the strictness level of the comparison. Default toSTRICT
.- Returns:
true
if the given object is considered equals to this math transform.- See Also:
-