Class EllipsoidToRadiusTransform
Object
FormattableObject
AbstractMathTransform
EllipsoidToRadiusTransform
- All Implemented Interfaces:
Serializable,Parameterized,LenientComparable,Printable,MathTransform
Conversion of spherical coordinates from (λ,Ω) to (λ,Ω,R) with points assumed to be on an ellipsoid surface.
For each coordinate tuple, this transform copies the spherical longitude (λ) and the spherical latitude (Ω),
then appends a R coordinate which is the distance from the sphere center to the ellipsoid surface
at the spherical latitude Ω. Notes:
- For a biaxial ellipsoid, the spherical longitude is the same as the geodetic longitude. For this reason, the same symbol (λ) is reused.
- This transform does not convert the spherical latitude (Ω) to geodetic latitude (φ).
That conversion is done by the inverse of
EllipsoidToCentricTransform.
Related operations
This transform is also namedSpherical 2D to 3D conversionby Apache SIS. This transform is similar to
Geographic 2D to 3D conversion(inverse of EPSG:9659 method), except that this spherical case sets R to a non-zero value that depends on the Ω value. By contrast, the geographic case unconditionally sets h to zero.
This transform is also related to the DefaultEllipsoid.getGeocentricRadius(double) method,
except that the latter expects geodetic latitudes
while this transform expects geocentric latitudes.
Purpose
This transform is used together with the inverse ofEllipsoidToCentricTransform when the
source coordinate system is spherical (EllipsoidToCentricTransform.TargetType.SPHERICAL).
The conversion from spherical latitude (Ω) to geodetic latitude (φ) depends on R.
When the latter is not specified, it is often assumed to be on the ellipsoid surface.- Since:
- 1.5
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final doubleThe square of the eccentricity. -
Constructor Summary
ConstructorsConstructorDescriptionEllipsoidToRadiusTransform(Ellipsoid surface) Creates a transform for an ellipsoid having a semi-major axis length of 1. -
Method Summary
Modifier and TypeMethodDescriptionstatic MathTransformcreateGeodeticConversion(MathTransformFactory factory, Ellipsoid surface) Creates a transform for the given ellipsoid.protected ContextualParametersReturns the parameters used for creating the complete conversion.Returns a description of the internal parameters of thisEllipsoidToRadiusTransformtransform.Returns a copy of internal parameter values of thisEllipsoidToRadiusTransformtransform.final intGets the dimension of input points, which is 2.final intGets the dimension of output points, which is 3.inverse()Returns the inverse of this transform.transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Converts the (λ,Ω) spherical coordinates to (λ,Ω,R), and optionally returns the derivative at that location.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Converts the (λ,Ω) spherical coordinates to (λ,Ω,R) in a sequence of coordinate tuples.protected voidtryConcatenate(TransformJoiner context) If the transform after this transform is dropping the third coordinate, removes this transform.Methods inherited from class AbstractMathTransform
derivative, equals, formatTo, getDomain, hashCode, isIdentity, transform, transform, transform, transform, tryConcatenateMethods inherited from class FormattableObject
print, toString, toString, toWKTMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface MathTransform
toWKT
-
Field Details
-
eccentricitySquared
protected final double eccentricitySquaredThe square of the eccentricity. This is defined as ℯ² = (a²-b²)/a² where a is the semi-major axis length and b is the semi-minor axis length.
-
-
Constructor Details
-
EllipsoidToRadiusTransform
Creates a transform for an ellipsoid having a semi-major axis length of 1.EllipsoidToRadiusTransforminstances expect input coordinates as below:- Spherical longitudes in any unit (they will pass-through),
- Spherical latitudes in radians.
Unit conversions
For a complete chain of transforms,EllipsoidToRadiusTransforminstances need to be concatenated with the following affine transforms:- Normalization before
EllipsoidToRadiusTransform:- Conversion of spherical latitudes from degrees to radians
- Denormalization after
EllipsoidToRadiusTransform:- Multiplication of R by the semi-minor axis length
EllipsoidToRadiusTransformconstruction, the full conversion chain including the above affine transforms can be created bygetContextualParameters().completeTransform(factory, this)}.- Parameters:
surface- the ellipsoid of the spherical coordinates for which to add a radius.- See Also:
-
-
Method Details
-
createGeodeticConversion
public static MathTransform createGeodeticConversion(MathTransformFactory factory, Ellipsoid surface) throws FactoryException Creates a transform for the given ellipsoid. This factory method combines theEllipsoidToRadiusTransforminstance with the steps needed for converting degrees to radians and expressing the results in units of the given ellipsoid.- Parameters:
factory- the factory to use for creating and concatenating the affine transforms.surface- the ellipsoid of the spherical coordinates for which to add a radius.- Returns:
- the conversion from two-dimensional to three-dimensional spherical coordinates.
- Throws:
FactoryException- if an error occurred while creating a transform.
-
getContextualParameters
Returns the parameters used for creating the complete conversion. Those parameters describe a sequence of normalize →this→ denormalize transforms, not including axis swapping.- Overrides:
getContextualParametersin classAbstractMathTransform- Returns:
- the parameter values for the normalize →
this→ denormalize chain of transforms.
-
getParameterValues
Returns a copy of internal parameter values of thisEllipsoidToRadiusTransformtransform. This method is mostly for debugging purposes since the isolation of non-linear parameters in this class is highly implementation dependent. Most GIS applications will instead be interested in the contextual parameters.- Specified by:
getParameterValuesin interfaceParameterized- Overrides:
getParameterValuesin classAbstractMathTransform- Returns:
- a copy of the internal parameter values for this transform.
- See Also:
-
getParameterDescriptors
Returns a description of the internal parameters of thisEllipsoidToRadiusTransformtransform.- Specified by:
getParameterDescriptorsin interfaceParameterized- Overrides:
getParameterDescriptorsin classAbstractMathTransform- Returns:
- a description of the internal parameters.
- See Also:
-
getSourceDimensions
public final int getSourceDimensions()Gets the dimension of input points, which is 2.- Specified by:
getSourceDimensionsin interfaceMathTransform- Specified by:
getSourceDimensionsin classAbstractMathTransform- Returns:
- always 2.
- See Also:
-
getTargetDimensions
public final int getTargetDimensions()Gets the dimension of output points, which is 3.- Specified by:
getTargetDimensionsin interfaceMathTransform- Specified by:
getTargetDimensionsin classAbstractMathTransform- Returns:
- always 3.
- See Also:
-
transform
public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws TransformException Converts the (λ,Ω) spherical coordinates to (λ,Ω,R), and optionally returns the derivative at that location.- 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 assrcPts. 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:
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 TransformException Converts the (λ,Ω) spherical coordinates to (λ,Ω,R) in a sequence of coordinate tuples. This method performs the same conversion astransform(double[], int, double[], int, boolean), but the formulas are repeated here for performance reasons.- Specified by:
transformin interfaceMathTransform- 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 assrcPts.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:
TransformException- if a point cannot be transformed.
-
inverse
Returns the inverse of this transform. The inverse transform drops the radius.- Specified by:
inversein interfaceMathTransform- Overrides:
inversein classAbstractMathTransform- Returns:
- the conversion from 3D to 2D spherical coordinates.
-
tryConcatenate
If the transform after this transform is dropping the third coordinate, removes this transform. Otherwise, allowsTransformJoinerto move the operations applied on the longitude value if this move can simplify the chain of transforms.- Overrides:
tryConcatenatein classAbstractMathTransform- Parameters:
context- information about the neighbor transforms, and the object where to set the result.- Throws:
FactoryException- if an error occurred while combining the transforms.- See Also:
-