Class EllipsoidToCentricTransform.Inverse
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.AbstractMathTransform.Inverse
org.apache.sis.referencing.operation.transform.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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EllipsoidToCentricTransform
The enclosing transform.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES
-
Constructor Summary
ConstructorsConstructorDescriptionInverse
(EllipsoidToCentricTransform forward) Creates the inverse of the enclosing transform. -
Method Summary
Modifier and TypeMethodDescription(package private) 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 (normallytransforms.get(index)
) if this conversion computes no height.org.opengis.referencing.operation.Matrix
derivative
(org.opengis.geometry.DirectPosition point) Computes the derivative at the given location.protected ContextualParameters
Returns the same contextual parameters than in the enclosing class, but with a different method name and the (de)normalization matrices inverted.org.opengis.parameter.ParameterDescriptorGroup
Returns a description of the internal parameters of this inverse transform.org.opengis.parameter.ParameterValueGroup
Returns the internal parameter values.org.opengis.referencing.operation.MathTransform
inverse()
Returns the inverse of this math transform.org.opengis.referencing.operation.Matrix
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Inverse transforms a single position in a list of coordinate values, and optionally returns the derivative at that location.void
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms the given array of points from geocentric to geographic coordinates.protected org.opengis.referencing.operation.MathTransform
tryConcatenate
(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform other, org.opengis.referencing.operation.MathTransformFactory factory) 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.Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform.Inverse
computeHashCode, equals, formatTo, getDomain, getSourceDimensions, getTargetDimensions, isIdentity
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
equals, hashCode, isInverseEquals, mismatchedDimension, transform, transform, transform, transform
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:
-
forward
The enclosing transform.
-
-
Constructor Details
-
Inverse
Inverse(EllipsoidToCentricTransform forward) Creates the inverse of the enclosing transform.
-
-
Method Details
-
inverse
public org.opengis.referencing.operation.MathTransform inverse()Returns the inverse of this math transform.- Specified by:
inverse
in interfaceorg.opengis.referencing.operation.MathTransform
- Specified by:
inverse
in classAbstractMathTransform.Inverse
- Returns:
- the inverse of this transform.
-
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 classAbstractMathTransform
- Returns:
- the parameter values for the sequence of normalize →
this
→ denormalize transforms, ornull
if unspecified. Callers should not modify the returned parameters, since modifications (if allowed) will generally not be reflected back in thisMathTransform
.
-
getParameterValues
Returns the internal parameter values. This is used only for debugging purpose.- Specified by:
getParameterValues
in interfaceParameterized
- Overrides:
getParameterValues
in classAbstractMathTransform
- 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
Returns a description of the internal parameters of this inverse transform. We do not cache this instance for two reasons:- it is only for debugging purposes, and
- the user may override
EllipsoidToCentricTransform.getParameterDescriptors()
.
- Specified by:
getParameterDescriptors
in interfaceParameterized
- Overrides:
getParameterDescriptors
in classAbstractMathTransform
- 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 interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
derivative
in classAbstractMathTransform.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 classAbstractMathTransform
- Parameters:
srcPts
- the array containing the source coordinates (cannot benull
).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 thansrcPts
. May benull
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, orfalse
if not needed.- Returns:
- the matrix of the transform derivative at the given source position,
or
null
if thederivate
argument isfalse
. - 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 interfaceorg.opengis.referencing.operation.MathTransform
- Overrides:
transform
in classAbstractMathTransform
- 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 thansrcPts
.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 tothis
.
-
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:- Inverse of Geographic/geocentric conversions (EPSG:9602)
- Geographic 3D to 2D conversion (EPSG:9659)
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 classAbstractMathTransform
- Parameters:
applyOtherFirst
-true
if the transformation order isother
followed bythis
, orfalse
if the transformation order isthis
followed byother
.other
- the other math transform to (pre-)concatenate with this transform.factory
- the factory which is (indirectly) invoking this method, ornull
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
Given a transformation chain to format in WKT, inserts a "Geographic 3D to 2D" pseudo-conversion after this transform (normallytransforms.get(index)
) if this conversion computes no height.- Overrides:
beforeFormat
in classAbstractMathTransform.Inverse
- Parameters:
transforms
- the full chain of concatenated transforms.index
- the index of this transform in thetransforms
chain.inverse
- alwaysfalse
, except if we are formatting the inverse transform.- Returns:
- index of this transform in the
transforms
chain after processing. - See Also:
-