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 EllipsoidToCentricTransformThe enclosing transform.private static final longSerial 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 intbeforeFormat(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.Matrixderivative(org.opengis.geometry.DirectPosition point) Computes the derivative at the given location.protected ContextualParametersReturns the same contextual parameters than in the enclosing class, but with a different method name and the (de)normalization matrices inverted.org.opengis.parameter.ParameterDescriptorGroupReturns a description of the internal parameters of this inverse transform.org.opengis.parameter.ParameterValueGroupReturns the internal parameter values.org.opengis.referencing.operation.MathTransforminverse()Returns the inverse of this math transform.org.opengis.referencing.operation.Matrixtransform(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.voidtransform(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.MathTransformtryConcatenate(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, isIdentityMethods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
equals, hashCode, isInverseEquals, mismatchedDimension, transform, transform, transform, transformMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
inversein interfaceorg.opengis.referencing.operation.MathTransform- Specified by:
inversein 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:
getContextualParametersin classAbstractMathTransform- Returns:
- the parameter values for the sequence of normalize →
this→ denormalize transforms, ornullif 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:
getParameterValuesin interfaceParameterized- Overrides:
getParameterValuesin classAbstractMathTransform- Returns:
- the parameter values for this math transform, or
nullif 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:
getParameterDescriptorsin interfaceParameterized- Overrides:
getParameterDescriptorsin classAbstractMathTransform- Returns:
- the parameter descriptors for this math transform, or
nullif 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:
derivativein interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
derivativein 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:
transformin 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 benullif only the derivative matrix is desired.dstOff- the offset to the location of the transformed point that is stored in the destination array.derivate-truefor computing the derivative, orfalseif not needed.- Returns:
- the matrix of the transform derivative at the given source position,
or
nullif thederivateargument 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:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin 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)
EllipsoidToCentricTransforminstance allow the following optimizations:- Avoid computation of h value.
- Allow use of the more efficient
AffineTransformafter this transform instead of a transform based on a matrix of size 3×4.
- Overrides:
tryConcatenatein classAbstractMathTransform- Parameters:
applyOtherFirst-trueif the transformation order isotherfollowed bythis, orfalseif the transformation order isthisfollowed byother.other- the other math transform to (pre-)concatenate with this transform.factory- the factory which is (indirectly) invoking this method, ornullif none.- Returns:
- the math transforms combined in an optimized way, or
nullif 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:
beforeFormatin classAbstractMathTransform.Inverse- Parameters:
transforms- the full chain of concatenated transforms.index- the index of this transform in thetransformschain.inverse- alwaysfalse, except if we are formatting the inverse transform.- Returns:
- index of this transform in the
transformschain after processing. - See Also:
-