Class Inverter
java.lang.Object
org.apache.sis.referencing.operation.matrix.MatrixSIS
org.apache.sis.referencing.operation.matrix.Matrix2
org.apache.sis.referencing.operation.projection.Inverter
- All Implemented Interfaces:
Serializable
,Cloneable
,LenientComparable
,org.opengis.referencing.operation.Matrix
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:
- Given a first estimation of (λ,φ), compute the forward projection (x′,y′) for that estimation together with the Jacobian matrix at that position.
- Compute the errors compared to the specified (x,y) values.
- Convert that (Δx,Δy) error into a (Δλ,Δφ) error using the inverse of the Jacobian matrix.
- Correct (λ,φ) and continue iteratively until the error is small enough.
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:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final void
inverseTransform
(Orthographic projection, double x, double y, double[] dstPts, int dstOff) Computes the inverse of the given projection.Methods inherited from class org.apache.sis.referencing.operation.matrix.Matrix2
castOrCopy, clone, equals, getElement, getElements, getNumCol, getNumRow, hashCode, isAffine, isIdentity, setElement, setElements, transpose
Methods inherited from class org.apache.sis.referencing.operation.matrix.MatrixSIS
convertAfter, convertBefore, equals, equals, getInteger, getNumber, inverse, multiply, multiply, normalizeColumns, removeColumns, removeRows, setMatrix, setNumber, solve, toString, translate
-
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, thedstPts[dstOff]
anddstPts[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 fromsrcPts[srcOff]
.y
- the northing value fromsrcPts[srcOff+1]
.dstPts
- the array where to refine the (λ,φ) values.dstOff
- index of the λ element in thedstPts
array.- Throws:
ProjectionException
- if the iterative algorithm does not converge.
-