Class MolodenskyFormula

All Implemented Interfaces:
Serializable, Parameterized, LenientComparable, org.opengis.referencing.operation.MathTransform
Direct Known Subclasses:
InterpolatedMolodenskyTransform, MolodenskyTransform

abstract class MolodenskyFormula extends DatumShiftTransform
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
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serial number for inter-operability with different versions.
      See Also:
    • ANGULAR_SCALE

      static final double ANGULAR_SCALE
      The 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 isSource3D
      true if the source coordinates have a height.
    • isTarget3D

      final boolean isTarget3D
      true if the target coordinates have a height.
    • isAbridged

      final boolean isAbridged
      true for the abridged formula, or false for the complete one.
    • tX

      protected final double tX
      Shift 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 tY
      Shift 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 tZ
      Shift along the geocentric Z axis (toward north pole) in units of the semi-major axis of the source ellipsoid.
      See Also:
    • Δa

      final double Δa
      Difference in the semi-major axes of the target and source ellipsoids: Δa = target a - source a.
      See Also:
    • Δfmod

      final double Δfmod
      Difference 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).
      where Δf = target flattening - source flattening.
    • semiMajor

      protected final double semiMajor
      Semi-major axis length (a) of the source ellipsoid.
    • eccentricitySquared

      protected final double eccentricitySquared
      The 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 given inverse transform.
      target - the target ellipsoid of the given inverse 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-null grid 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, or null if none.
      isAbridged - true for the abridged formula, or false for the complete one.
      descriptor - the contextual parameter descriptor.
  • Method Details

    • getParameterValues

      @Debug public org.opengis.parameter.ParameterValueGroup 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 interface Parameterized
      Overrides:
      getParameterValues in class DatumShiftTransform
      Returns:
      a copy of the internal parameter values for this transform.
      See Also:
    • completeParameters

      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. 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)
      The default implementation sets the "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 of unit.
      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 interface org.opengis.referencing.operation.MathTransform
      Specified by:
      getSourceDimensions in class AbstractMathTransform
      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 interface org.opengis.referencing.operation.MathTransform
      Specified by:
      getTargetDimensions in class AbstractMathTransform
      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 of AbstractMathTransform.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:
      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, or null.
      dstOff - the offset to the location of the transformed point that is stored in the destination array.
      tX - the tX field value (or a slightly different value during geocentric interpolation).
      tY - the tY field value (or a slightly different value during geocentric interpolation).
      tZ - the tZ field value (or a slightly different value during geocentric interpolation).
      offset - an array of length 3 if this method should use the interpolation grid, or null otherwise.
      derivate - true for computing the derivative, or false 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 by AbstractMathTransform.hashCode() when first needed.
      Overrides:
      computeHashCode in class DatumShiftTransform
      Returns:
      the hash code value. This value may change between different execution of the Apache SIS library.
    • equals

      public 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 DatumShiftTransform
      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 considered equals to this math transform.
      See Also: