org.geotoolkit.referencing.operation.transform
Class GeocentricTransform

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by GeocentricTransform
All Implemented Interfaces:
Serializable, Formattable, EllipsoidalTransform, Parameterized, LenientComparable, MathTransform

@Immutable
public class GeocentricTransform
extends AbstractMathTransform
implements EllipsoidalTransform, Serializable

Transforms three dimensional geographic points to geocentric coordinate points. Input points must be longitudes, latitudes and heights above the ellipsoid.

See any of the following providers for a list of programmatic parameters:

Since:
1.2
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys), PROJ4 Project for formulas
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected GeocentricTransform(double semiMajor, double semiMinor, Unit<Length> units, boolean hasHeight)
          Creates a transform from the specified parameters.
protected GeocentricTransform(GeocentricTransform original, boolean hasHeight)
          Creates a new transform with the same ellipsoidal parameters than the given transform, but a different number of source dimensions.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this transform.
static MathTransform create(double semiMajor, double semiMinor, Unit<Length> units, boolean hasHeight)
          Constructs a transform from the specified parameters.
static MathTransform create(Ellipsoid ellipsoid, boolean hasHeight)
          Constructs a transform from the specified ellipsoid.
 Matrix derivative(DirectPosition point)
          Gets the derivative of this transform at a point.
 boolean equals(Object object, ComparisonMode mode)
          Compares the specified object with this math transform for equality.
 GeocentricTransform forDimensions(boolean source3D, boolean target3D)
          Returns a transform having the same ellipsoidal parameters than this transform, but a different number of source dimensions.
 ParameterDescriptorGroup getParameterDescriptors()
          Returns the parameter descriptors for this math transform.
 ParameterValueGroup getParameterValues()
          Returns the parameter values for this math 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.
 EllipsoidalTransform inverse()
          Returns the inverse of this transform.
protected  void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff)
          Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.
 void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.
 void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.
 
Methods inherited from class AbstractMathTransform
createTransformedShape, derivative, ensureNonNull, equals, formatWKT, getName, hashCode, isIdentity, rollLongitude, transform, transform
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface MathTransform
isIdentity, toWKT, transform
 

Constructor Detail

GeocentricTransform

protected GeocentricTransform(double semiMajor,
                              double semiMinor,
                              Unit<Length> units,
                              boolean hasHeight)
Creates a transform from the specified parameters.

WARNING: Current implementation expects longitude and latitude ordinates in decimal degrees, but it may be changed to radians in a future version. The static factory method will preserve the decimal degrees contract.

Parameters:
semiMajor - The semi-major axis length.
semiMinor - The semi-minor axis length.
units - The axis units.
hasHeight - true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are only 2-D.
See Also:
create(double, double, Unit, boolean)

GeocentricTransform

protected GeocentricTransform(GeocentricTransform original,
                              boolean hasHeight)
Creates a new transform with the same ellipsoidal parameters than the given transform, but a different number of source dimensions.

Parameters:
original - The transform to copy.
hasHeight - true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are only 2-D.
Since:
3.16
Method Detail

create

public static MathTransform create(Ellipsoid ellipsoid,
                                   boolean hasHeight)
Constructs a transform from the specified ellipsoid. The returned transform expects (longitude, latitude, height) source coordinates where the longitudes and latitudes are in decimal degrees, and the height is optional (depending on the value of the hasHeight argument).

Parameters:
ellipsoid - The ellipsoid.
hasHeight - true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are only 2-D.
Returns:
The transform from geographic to geocentric coordinates.
Since:
3.15

create

public static MathTransform create(double semiMajor,
                                   double semiMinor,
                                   Unit<Length> units,
                                   boolean hasHeight)
Constructs a transform from the specified parameters. The returned transform expects (longitude, latitude, height) source coordinates where the longitudes and latitudes are in decimal degrees, and the height is optional (depending on the value of the hasHeight argument).

Parameters:
semiMajor - The semi-major axis length.
semiMinor - The semi-minor axis length.
units - The axis units.
hasHeight - true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are only 2-D.
Returns:
The transform from geographic to geocentric coordinates.
Since:
3.15

getParameterDescriptors

public ParameterDescriptorGroup getParameterDescriptors()
Returns the parameter descriptors for this math transform.

Specified by:
getParameterDescriptors in interface Parameterized
Overrides:
getParameterDescriptors in class AbstractMathTransform
Returns:
The parameter descriptors for this math transform, or null.
See Also:
OperationMethod.getParameters()

getParameterValues

public ParameterValueGroup getParameterValues()
Returns the parameter values for this math transform.

Specified by:
getParameterValues in interface Parameterized
Overrides:
getParameterValues in class AbstractMathTransform
Returns:
A copy of the parameter values for this math transform.
See Also:
SingleOperation.getParameterValues()

forDimensions

public GeocentricTransform forDimensions(boolean source3D,
                                         boolean target3D)
                                  throws IllegalArgumentException
Returns a transform having the same ellipsoidal parameters than this transform, but a different number of source dimensions. The number of target dimensions can not be changed, because the target coordinate system is not ellipsoidal.
Note: In the inverse transform case, the above-cited conditions for the source3D and target3D arguments are interchanged.

Specified by:
forDimensions in interface EllipsoidalTransform
Parameters:
source3D - true if the source coordinates have a height.
target3D - Must always be true.
Returns:
A transform having the requested source dimensions (may be this).
Throws:
IllegalArgumentException - If target3D is false.
Since:
3.16

getSourceDimensions

public final int getSourceDimensions()
Gets the dimension of input points, which is 2 or 3.

Specified by:
getSourceDimensions in interface MathTransform
Specified by:
getSourceDimensions in class AbstractMathTransform

getTargetDimensions

public final int getTargetDimensions()
Gets the dimension of output points, which is 3.

Specified by:
getTargetDimensions in interface MathTransform
Specified by:
getTargetDimensions in class AbstractMathTransform

transform

protected void transform(double[] srcPts,
                         int srcOff,
                         double[] dstPts,
                         int dstOff)
Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.

Specified by:
transform in class AbstractMathTransform
Parameters:
srcPts - The array containing the source point coordinates.
srcOff - The offset to the point to be transformed in the source array.
dstPts - the array into which the transformed point coordinate are returned. May be the same than srcPts.
dstOff - The offset to the location of the transformed point that is stored in the destination array.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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 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.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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 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.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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.
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.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Converts geodetic coordinates (longitude, latitude, height) to geocentric coordinates (x, y, z) according to the current ellipsoid parameters.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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.
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.

derivative

public Matrix derivative(DirectPosition point)
Gets the derivative of this transform at a point.

Specified by:
derivative in interface MathTransform
Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point as a 3×2 or 3×3 matrix.
Since:
3.16

inverse

public EllipsoidalTransform inverse()
Returns the inverse of this transform.

Specified by:
inverse in interface MathTransform
Overrides:
inverse in class AbstractMathTransform

computeHashCode

protected int computeHashCode()
Computes a hash value for this transform. This method is invoked by AbstractMathTransform.hashCode() when first needed.

Overrides:
computeHashCode in class AbstractMathTransform
Returns:
The hash code value. This value may change between different execution of the Geotk library.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares the specified object with this math transform for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractMathTransform
Parameters:
object - The object to compare with this transform.
mode - The strictness level of the comparison. Default to STRICT.
Returns:
true if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.