All Implemented Interfaces:
Serializable, Cloneable, LenientComparable, org.opengis.referencing.operation.Matrix

final class Inverter extends Matrix2
A temporary Jacobian matrix where to write the derivative of a forward projection. This Jacobian matrix is used for calculation of reverse projection when no inverse formulas is available, or when the inverse formula is too approximate (for example because eccentricity is too high). This class processes as below:
  1. Given a first estimation of (λ,φ), compute the forward projection (x′,y′) for that estimation together with the Jacobian matrix at that position.
  2. Compute the errors compared to the specified (x,y) values.
  3. Convert that (Δx,Δy) error into a (Δλ,Δφ) error using the inverse of the Jacobian matrix.
  4. Correct (λ,φ) and continue iteratively until the error is small enough.
This algorithm described in EPSG guidance note for Orthographic projection but can be applied to any map projection, not only orthographic.

This algorithm is defined in a Matrix2 subclass for allowing map projection implementations to use if (derivative instanceof Inverter) check for detecting when a transform method is invoked for the purpose of a reverse projection.

Since:
1.1
Version:
1.1
See Also:
  • Constructor Details

    • Inverter

      Inverter()
      Creates a new matrix initialized to identity.
  • Method Details

    • inverseTransform

      final void inverseTransform(Orthographic projection, double x, double y, double[] dstPts, int dstOff) throws ProjectionException
      Computes the inverse of the given projection. Before this method is invoked, the dstPts[dstOff] and dstPts[dstOff+1] array elements must contain the initial λ and φ estimations respectively. After method returns, the same array elements contain the refined λ and φ values.

      Note: restricted to Orthographic projection for now, but may be generalized to any projection in a future version.

      Parameters:
      projection - the forward projection for which to compute a reverse projection.
      x - the easting value from srcPts[srcOff].
      y - the northing value from srcPts[srcOff+1].
      dstPts - the array where to refine the (λ,φ) values.
      dstOff - index of the λ element in the dstPts array.
      Throws:
      ProjectionException - if the iterative algorithm does not converge.