org.deegree_impl.model.ct
Class GeocentricTransform

java.lang.Object
  extended byorg.deegree_impl.model.ct.AbstractMathTransform
      extended byorg.deegree_impl.model.ct.GeocentricTransform
All Implemented Interfaces:
MathTransform, java.io.Serializable

class GeocentricTransform
extends AbstractMathTransform
implements java.io.Serializable

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

Version:
1.00
Author:
Frank Warmerdam, Martin Desruisseaux

Nested Class Summary
private  class GeocentricTransform.Inverse
          Inverse of a geocentric transform.
(package private) static class GeocentricTransform.Provider
          The provider for GeocentricTransform.
 
Field Summary
private  double a
          Semi-major axis of ellipsoid in meters.
private  double a2
          Square of semi-major axis (@link #a}²).
private static double AD_C
          Toms region 1 constant.
private  double b
          Semi-minor axis of ellipsoid in meters.
private  double b2
          Square of semi-minor axis (b²).
private static double COS_67P5
          Cosine of 67.5 degrees.
private  double e2
          Eccentricity squared.
private  double ep2
          2nd eccentricity squared.
private  boolean hasHeight
          true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are strictly 2-D.
private  MathTransform inverse
          The inverse of this transform.
private static double MAX_ERROR
          Maximal error tolerance in metres during // assertions, in metres.
private static long serialVersionUID
          Serial number for interoperability with different versions.
 
Constructor Summary
protected GeocentricTransform(double semiMajor, double semiMinor, Unit units, boolean hasHeight)
          Construct a transform.
protected GeocentricTransform(Ellipsoid ellipsoid, boolean hasHeight)
          Construct a transform.
 
Method Summary
private static void checkArgument(java.lang.String name, double value, double max)
          Check an argument value.
private  double checkTransform(double[] points)
          Transform the last half if the specified array and returns the distance with the first half.
 boolean equals(java.lang.Object object)
          Compares the specified object with this math transform for equality.
 int getDimSource()
          Gets the dimension of input points, which is 2 or 3.
 int getDimTarget()
          Gets the dimension of output points, which is 3.
 int hashCode()
          Returns a hash value for this transform.
 MathTransform inverse()
          Returns the inverse of this transform.
protected  void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Converts geocentric coordinates (x, y, z) to geodetic coordinates (longitude, latitude, height), according to the current ellipsoid parameters.
protected  void inverseTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Converts geocentric coordinates (x, y, z) to geodetic coordinates (longitude, latitude, height), according to the current ellipsoid parameters.
 boolean isIdentity()
          Tests whether this transform does not move any points.
 java.lang.String toString()
          Returns the WKT for this math transform.
(package private)  java.lang.String toString(java.lang.String classification)
          Returns the WKT for this math transform with the specified classification name.
 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.
private  void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts, boolean hasHeight)
          Implementation of geodetic to geocentric conversion.
 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 org.deegree_impl.model.ct.AbstractMathTransform
addParameter, addParameter, createTransformedShape, createTransformedShape, derivative, derivative, getName, paramMT, toOpenGIS, transform, transform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial number for interoperability with different versions.

See Also:
Constant Field Values

MAX_ERROR

private static final double MAX_ERROR
Maximal error tolerance in metres during // assertions, in metres. If // assertions are enabled (JDK 1.4 only), then every coordinates transformed with inverseTransform(double[], int, double[], int, int) will be transformed again with transform(double[], int, double[], int, int). If the distance between the resulting position and the original position is greater than MAX_ERROR, then a // assertionError is thrown.

See Also:
Constant Field Values

COS_67P5

private static final double COS_67P5
Cosine of 67.5 degrees.

See Also:
Constant Field Values

AD_C

private static final double AD_C
Toms region 1 constant.

See Also:
Constant Field Values

a

private final double a
Semi-major axis of ellipsoid in meters.


b

private final double b
Semi-minor axis of ellipsoid in meters.


a2

private final double a2
Square of semi-major axis (@link #a}²).


b2

private final double b2
Square of semi-minor axis (b²).


e2

private final double e2
Eccentricity squared.


ep2

private final double ep2
2nd eccentricity squared.


hasHeight

private final boolean hasHeight
true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are strictly 2-D.


inverse

private transient MathTransform inverse
The inverse of this transform. Will be created only when needed.

Constructor Detail

GeocentricTransform

protected GeocentricTransform(Ellipsoid ellipsoid,
                              boolean hasHeight)
Construct a transform.

Parameters:
ellipsoid - The ellipsoid.
hasHeight - true if geographic coordinates include an ellipsoidal height (i.e. are 3-D), or false if they are strictly 2-D.

GeocentricTransform

protected GeocentricTransform(double semiMajor,
                              double semiMinor,
                              Unit units,
                              boolean hasHeight)
Construct a transform.

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 strictly 2-D.
Method Detail

checkArgument

private static void checkArgument(java.lang.String name,
                                  double value,
                                  double max)
                           throws java.lang.IllegalArgumentException
Check an argument value. The argument must be greater than 0 and finite, otherwise an exception is thrown.

Parameters:
name - The argument name.
value - The argument value.
max - The maximal legal argument value.
Throws:
java.lang.IllegalArgumentException

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
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

private void transform(double[] srcPts,
                       int srcOff,
                       double[] dstPts,
                       int dstOff,
                       int numPts,
                       boolean hasHeight)
Implementation of geodetic to geocentric conversion. This implementation allows the caller to use height in computation.


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

inverseTransform

protected final void inverseTransform(double[] srcPts,
                                      int srcOff,
                                      double[] dstPts,
                                      int dstOff,
                                      int numPts)
Converts geocentric coordinates (x, y, z) to geodetic coordinates (longitude, latitude, height), according to the current ellipsoid parameters. The method used here is derived from "An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion", by Ralph Toms, Feb 1996.


inverseTransform

protected final void inverseTransform(float[] srcPts,
                                      int srcOff,
                                      float[] dstPts,
                                      int dstOff,
                                      int numPts)
Converts geocentric coordinates (x, y, z) to geodetic coordinates (longitude, latitude, height), according to the current ellipsoid parameters. The method used here is derived from "An Improved Algorithm for Geocentric to Geodetic Coordinate Conversion", by Ralph Toms, Feb 1996.


checkTransform

private double checkTransform(double[] points)
Transform the last half if the specified array and returns the distance with the first half. Array points must have a length of 6.


getDimSource

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

Specified by:
getDimSource in interface MathTransform
See Also:
CT_MathTransform.getDimSource()

getDimTarget

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

Specified by:
getDimTarget in interface MathTransform
See Also:
CT_MathTransform.getDimTarget()

isIdentity

public final boolean isIdentity()
Tests whether this transform does not move any points. This method returns always false.

Specified by:
isIdentity in interface MathTransform
Returns:
true if this MathTransform is an identity transform; false otherwise.

inverse

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

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

hashCode

public final int hashCode()
Returns a hash value for this transform.

Overrides:
hashCode in class AbstractMathTransform

equals

public final boolean equals(java.lang.Object object)
Compares the specified object with this math transform for equality.

Overrides:
equals in class AbstractMathTransform

toString

public final java.lang.String toString()
Returns the WKT for this math transform.

Overrides:
toString in class AbstractMathTransform

toString

final java.lang.String toString(java.lang.String classification)
Returns the WKT for this math transform with the specified classification name. The classification name should be "Ellipsoid_To_Geocentric" or "Geocentric_To_Ellipsoid".