Class EllipsoidToCentricTransform.Inverse

All Implemented Interfaces:
Serializable, Parameterized, LenientComparable, org.opengis.referencing.operation.MathTransform
Enclosing class:
EllipsoidToCentricTransform

private static final class EllipsoidToCentricTransform.Inverse extends AbstractMathTransform.Inverse implements Serializable
Converts Cartesian coordinates (X,Y,Z) to ellipsoidal coordinates (λ,φ) or (λ,φ,h).
Since:
0.7
Version:
1.0
  • Field Details

    • serialVersionUID

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

      private final EllipsoidToCentricTransform forward
      The enclosing transform.
  • Constructor Details

  • Method Details

    • inverse

      public org.opengis.referencing.operation.MathTransform inverse()
      Returns the inverse of this math transform.
      Specified by:
      inverse in interface org.opengis.referencing.operation.MathTransform
      Specified by:
      inverse in class AbstractMathTransform.Inverse
      Returns:
      the inverse of this transform.
    • getContextualParameters

      protected ContextualParameters getContextualParameters()
      Returns the same contextual parameters than in the enclosing class, but with a different method name and the (de)normalization matrices inverted.
      Overrides:
      getContextualParameters in class AbstractMathTransform
      Returns:
      the parameter values for the sequence of normalizethisdenormalize transforms, or null if unspecified. Callers should not modify the returned parameters, since modifications (if allowed) will generally not be reflected back in this MathTransform.
    • getParameterValues

      @Debug public org.opengis.parameter.ParameterValueGroup getParameterValues()
      Returns the internal parameter values. This is used only for debugging purpose.
      Specified by:
      getParameterValues in interface Parameterized
      Overrides:
      getParameterValues in class AbstractMathTransform
      Returns:
      the parameter values for this math transform, or null if unspecified. Note that those parameters may be normalized (e.g. represent a transformation of an ellipsoid of semi-major axis length of 1).
      See Also:
    • getParameterDescriptors

      @Debug public org.opengis.parameter.ParameterDescriptorGroup getParameterDescriptors()
      Returns a description of the internal parameters of this inverse transform. We do not cache this instance for two reasons:
      Specified by:
      getParameterDescriptors in interface Parameterized
      Overrides:
      getParameterDescriptors in class AbstractMathTransform
      Returns:
      the parameter descriptors for this math transform, or null if unspecified.
      See Also:
    • derivative

      public org.opengis.referencing.operation.Matrix derivative(org.opengis.geometry.DirectPosition point) throws org.opengis.referencing.operation.TransformException
      Computes the derivative at the given location. We need to override this method because we will inverse 3×2 matrices in a special way, with the knowledge that h can be set to 0.
      Specified by:
      derivative in interface org.opengis.referencing.operation.MathTransform
      Overrides:
      derivative in class AbstractMathTransform.Inverse
      Parameters:
      point - the coordinate tuple where to evaluate the derivative.
      Returns:
      the derivative at the specified point (never null).
      Throws:
      org.opengis.referencing.operation.TransformException - if the derivative cannot be evaluated at the specified point.
    • transform

      public org.opengis.referencing.operation.Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws org.opengis.referencing.operation.TransformException
      Inverse transforms a single position in a list of coordinate values, and optionally returns the derivative at that location.

      This method delegates the derivative computation to the enclosing class, then inverses the result. This is much easier than trying to compute the derivative from the formulas of this inverse transform.

      Specified by:
      transform in 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 null if only the derivative matrix is desired.
      dstOff - the offset to the location of the transformed point that is stored in the destination array.
      derivate - true for computing the derivative, or false if not needed.
      Returns:
      the matrix of the transform derivative at the given source position, or null if the derivate argument is false.
      Throws:
      org.opengis.referencing.operation.TransformException - if the point cannot be transformed or if a problem occurred while calculating the derivative.
      See Also:
    • transform

      public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws org.opengis.referencing.operation.TransformException
      Transforms the given array of points from geocentric to geographic coordinates. This method delegates the work to the enclosing class.
      Specified by:
      transform in interface org.opengis.referencing.operation.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.
      Throws:
      org.opengis.referencing.operation.TransformException - if a point cannot be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with Double.NaN values, continue and throw the exception only at end. Implementations that fall in the latter case should set the last completed transform to this.
    • tryConcatenate

      protected org.opengis.referencing.operation.MathTransform tryConcatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) throws org.opengis.util.FactoryException
      If this transform returns three-dimensional outputs, and if the transform just after this one just drops the height values, then replaces this transform by a two-dimensional one. The intent is to handle the following sequence of operations defined in the EPSG database:
      1. Inverse of Geographic/geocentric conversions (EPSG:9602)
      2. Geographic 3D to 2D conversion (EPSG:9659)
      Replacing the above sequence by a two-dimensional EllipsoidToCentricTransform instance allow the following optimizations:
      • Avoid computation of h value.
      • Allow use of the more efficient AffineTransform after this transform instead of a transform based on a matrix of size 3×4.
      Overrides:
      tryConcatenate in class AbstractMathTransform
      Parameters:
      applyOtherFirst - true if the transformation order is other followed by this, or false if the transformation order is this followed by other.
      other - the other math transform to (pre-)concatenate with this transform.
      factory - the factory which is (indirectly) invoking this method, or null if none.
      Returns:
      the math transforms combined in an optimized way, or null if no such optimization is available.
      Throws:
      org.opengis.util.FactoryException - if an error occurred while combining the transforms.
      See Also:
    • beforeFormat

      final int beforeFormat(List<Object> transforms, int index, boolean inverse)
      Given a transformation chain to format in WKT, inserts a "Geographic 3D to 2D" pseudo-conversion after this transform (normally transforms.get(index)) if this conversion computes no height.
      Overrides:
      beforeFormat in class AbstractMathTransform.Inverse
      Parameters:
      transforms - the full chain of concatenated transforms.
      index - the index of this transform in the transforms chain.
      inverse - always false, except if we are formatting the inverse transform.
      Returns:
      index of this transform in the transforms chain after processing.
      See Also: