public class EllipsoidToCentricTransform extends AbstractMathTransform implements Serializable
MathTransform
has been created:
EllipsoidToCentricTransform
instances created directly by the constructor expect (λ,φ) values
in radians and compute (X,Y,Z) values in units of an ellipsoid having a semi-major axis length of 1.
That constructor is reserved for subclasses only.createGeodeticConversion(…)
static method expect
(λ,φ) values in degrees and compute (X,Y,Z) values in units of the ellipsoid axes (usually metres).Defined in the sis-referencing
module
Modifier and Type | Class and Description |
---|---|
static class |
EllipsoidToCentricTransform.TargetType
Whether the output coordinate system is Cartesian or Spherical.
|
Modifier and Type | Field and Description |
---|---|
protected double |
eccentricitySquared
The square of eccentricity: ℯ² = (a²-b²)/a² where
a is the semi-major axis length and
b is the semi-minor axis length.
|
Modifier | Constructor and Description |
---|---|
protected |
EllipsoidToCentricTransform(double semiMajor,
double semiMinor,
Unit<Length> unit,
boolean withHeight,
EllipsoidToCentricTransform.TargetType target)
Creates a transform from angles in radians on ellipsoid having a semi-major axis length of 1.
|
Modifier and Type | Method and Description |
---|---|
protected int |
computeHashCode()
Computes a hash value for this transform.
|
static MathTransform |
createGeodeticConversion(MathTransformFactory factory,
double semiMajor,
double semiMinor,
Unit<Length> unit,
boolean withHeight,
EllipsoidToCentricTransform.TargetType target)
Creates a transform from geographic to geocentric coordinates.
|
static MathTransform |
createGeodeticConversion(MathTransformFactory factory,
Ellipsoid ellipsoid,
boolean withHeight)
Creates a transform from geographic to Cartesian geocentric coordinates (convenience method).
|
Matrix |
derivative(DirectPosition point)
Computes the derivative at the given location.
|
boolean |
equals(Object object,
ComparisonMode mode)
Compares the specified object with this math transform for equality.
|
protected ContextualParameters |
getContextualParameters()
Returns the parameters used for creating the complete conversion.
|
ParameterDescriptorGroup |
getParameterDescriptors()
Returns a description of the internal parameters of this
EllipsoidToCentricTransform transform. |
ParameterValueGroup |
getParameterValues()
Returns a copy of internal parameter values of this
EllipsoidToCentricTransform transform. |
int |
getSourceDimensions()
Gets the dimension of input points, which is 2 or 3.
|
int |
getTargetDimensions()
Gets the dimension of output points, which is 3.
|
EllipsoidToCentricTransform.TargetType |
getTargetType()
Returns whether the target coordinate system is Cartesian or Spherical.
|
MathTransform |
inverse()
Returns the inverse of this transform.
|
protected void |
inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Converts Cartesian coordinates (X,Y,Z) to ellipsoidal coordinates
(λ,φ) or (λ,φ,h).
|
Matrix |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
boolean derivate)
Converts the (λ,φ) or (λ,φ,h) geodetic coordinates to
to (X,Y,Z) geocentric coordinates,
and optionally returns the derivative at that location.
|
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Converts the (λ,φ) or (λ,φ,h) geodetic coordinates to
to (X,Y,Z) geocentric coordinates.
|
protected MathTransform |
tryConcatenate(boolean applyOtherFirst,
MathTransform other,
MathTransformFactory factory)
If this transform expects three-dimensional inputs, and if the transform just before this one
unconditionally sets the height to zero, then replaces this transform by a two-dimensional one.
|
equals, formatTo, hashCode, isIdentity, transform, transform, transform, transform
print, toString, toString, toWKT
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toWKT
protected final double eccentricitySquared
protected EllipsoidToCentricTransform(double semiMajor, double semiMinor, Unit<Length> unit, boolean withHeight, EllipsoidToCentricTransform.TargetType target)
EllipsoidToCentricTransform
instances expect input coordinates
as below:
EllipsoidToCentricTransform
instances need to be concatenated with the following affine transforms:
EllipsoidToCentricTransform
:EllipsoidToCentricTransform
:EllipsoidToCentricTransform
construction,
the full conversion chain including the above affine transforms can be created by
getContextualParameters().completeTransform(factory, this)}
.semiMajor
- the semi-major axis length.semiMinor
- the semi-minor axis length.unit
- the unit of measurement for the semi-axes and the ellipsoidal height.withHeight
- true
if source geographic coordinates include an ellipsoidal height
(i.e. are 3-D), or false
if they are only 2-D.target
- whether the target coordinate shall be Cartesian or Spherical.createGeodeticConversion(MathTransformFactory, double, double, Unit, boolean, TargetType)
public static MathTransform createGeodeticConversion(MathTransformFactory factory, double semiMajor, double semiMinor, Unit<Length> unit, boolean withHeight, EllipsoidToCentricTransform.TargetType target) throws FactoryException
EllipsoidToCentricTransform
instance with the steps needed for converting degrees to
radians and expressing the results in units of the given ellipsoid.
Input coordinates are expected to contain:
factory
- the factory to use for creating and concatenating the affine transforms.semiMajor
- the semi-major axis length.semiMinor
- the semi-minor axis length.unit
- the unit of measurement for the semi-axes and the ellipsoidal height.withHeight
- true
if source geographic coordinates include an ellipsoidal height
(i.e. are 3-D), or false
if they are only 2-D.target
- whether the target coordinate shall be Cartesian or Spherical.FactoryException
- if an error occurred while creating a transform.public static MathTransform createGeodeticConversion(MathTransformFactory factory, Ellipsoid ellipsoid, boolean withHeight) throws FactoryException
createGeodeticConversion(factory, ellipsoid.getSemiMajorAxis(), ellipsoid.getSemiMinorAxis(), ellipsoid.getAxisUnit(), withHeight, TargetType.CARTESIAN);The target type is assumed Cartesian because this is the most frequently used target.
factory
- the factory to use for creating and concatenating the affine transforms.ellipsoid
- the semi-major and semi-minor axis lengths with their unit of measurement.withHeight
- true
if source geographic coordinates include an ellipsoidal height
(i.e. are 3-D), or false
if they are only 2-D.FactoryException
- if an error occurred while creating a transform.protected ContextualParameters getContextualParameters()
this
→ denormalize transforms, not
including axis swapping.
Those parameters are used for formatting Well Known Text (WKT) and error messages.getContextualParameters
in class AbstractMathTransform
this
→ denormalize transforms.@Debug public ParameterValueGroup getParameterValues()
EllipsoidToCentricTransform
transform.
The returned group contains parameter values for the number of dimensions and the eccentricity.
getParameterValues
in interface Parameterized
getParameterValues
in class AbstractMathTransform
AbstractMathTransform.getContextualParameters()
,
AbstractSingleOperation.getParameterValues()
@Debug public ParameterDescriptorGroup getParameterDescriptors()
EllipsoidToCentricTransform
transform.
The returned group contains parameter descriptors for the number of dimensions and the eccentricity.getParameterDescriptors
in interface Parameterized
getParameterDescriptors
in class AbstractMathTransform
DefaultOperationMethod.getParameters()
public final int getSourceDimensions()
getSourceDimensions
in interface MathTransform
getSourceDimensions
in class AbstractMathTransform
DefaultOperationMethod.getSourceDimensions()
public final int getTargetDimensions()
getTargetDimensions
in interface MathTransform
getTargetDimensions
in class AbstractMathTransform
DefaultOperationMethod.getTargetDimensions()
public final EllipsoidToCentricTransform.TargetType getTargetType()
public Matrix derivative(DirectPosition point) throws TransformException
MathTransform
contract by accepting two- or three-dimensional
points even if the number of dimensions does not match the getSourceDimensions()
value.
derivative
in interface MathTransform
derivative
in class AbstractMathTransform
point
- the coordinate point where to evaluate the derivative.null
).TransformException
- if the derivative can not be evaluated at the specified point.public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws TransformException
transform
in class AbstractMathTransform
srcPts
- the array containing the source coordinate (can not be null
).srcOff
- the offset to the point to be transformed in the source array.dstPts
- the array into which the transformed coordinate is returned. May be the same than srcPts
.
May be null
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, or false
if not needed.null
if the derivate
argument is false
.TransformException
- if the point can not be transformed or
if a problem occurred while calculating the derivative.AbstractMathTransform.derivative(DirectPosition)
,
AbstractMathTransform.transform(DirectPosition, DirectPosition)
,
MathTransforms.derivativeAndTransform(MathTransform, double[], int, double[], int)
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws TransformException
transform(double[], int, double[], int, boolean)
,
but the formulas are repeated here for performance reasons.transform
in interface MathTransform
transform
in class AbstractMathTransform
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 than srcPts
.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.TransformException
- if a point can not be transformed.protected void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws TransformException
inverse()
.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 than srcPts
.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.TransformException
- if the calculation does not converge.public MathTransform inverse()
inverseTransform(double[], int, double[], int, int)
.inverse
in interface MathTransform
inverse
in class AbstractMathTransform
protected int computeHashCode()
AbstractMathTransform.hashCode()
when first needed.computeHashCode
in class AbstractMathTransform
public boolean equals(Object object, ComparisonMode mode)
equals
in interface LenientComparable
equals
in class AbstractMathTransform
object
- the object to compare with this transform.mode
- the strictness level of the comparison. Default to STRICT
.true
if the given object is considered equals to this math transform.Utilities.deepEquals(Object, Object, ComparisonMode)
protected MathTransform tryConcatenate(boolean applyOtherFirst, MathTransform other, MathTransformFactory factory) throws FactoryException
EllipsoidToCentricTransform
instance
allow the following optimizations:
AffineTransform
before this transform
instead than a transform based on a matrix of size 4×3.tryConcatenate
in class AbstractMathTransform
applyOtherFirst
- true
if the transformation order is other
followed by this
, or
false
if the transformation order is this
followed by other
.other
- the other math transform to (pre-)concatenate with this transform.factory
- the factory which is (indirectly) invoking this method, or null
if none.null
if no optimized combined transform is available.FactoryException
- if an error occurred while combining the transforms.DefaultMathTransformFactory.createConcatenatedTransform(MathTransform, MathTransform)
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.