org.deegree_impl.model.cs
Class Ellipsoid

java.lang.Object
  extended byorg.deegree_impl.model.cs.Info
      extended byorg.deegree_impl.model.cs.Ellipsoid
All Implemented Interfaces:
java.io.Serializable

public class Ellipsoid
extends Info

The figure formed by the rotation of an ellipse about an axis. In this context, the axis of rotation is always the minor axis. It is named geodetic ellipsoid if the parameters are derived by the measurement of the shape and the size of the Earth to approximate the geoid as close as possible.

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux
See Also:
CS_Ellipsoid, Serialized Form

Nested Class Summary
private  class Ellipsoid.Export
          Wrap a Ellipsoid object for use with OpenGIS.
 
Nested classes inherited from class org.deegree_impl.model.cs.Info
Info.AngularUnit, Info.LinearUnit
 
Field Summary
private  double inverseFlattening
          The inverse of the flattening value, or Double.POSITIVE_INFINITY if the ellipsoid is a sphere.
private  boolean ivfDefinitive
          Is the Inverse Flattening definitive for this ellipsoid?
private  double semiMajorAxis
          The equatorial radius.
private  double semiMinorAxis
          The polar radius.
private static long serialVersionUID
          Serial number for interoperability with different versions.
private  Unit unit
          The units of the semi-major and semi-minor axis values.
static Ellipsoid WGS84
          WGS 1984 ellipsoid.
 
Fields inherited from class org.deegree_impl.model.cs.Info
pool
 
Constructor Summary
(package private) Ellipsoid(java.util.Map properties, double semiMajorAxis, double semiMinorAxis, double inverseFlattening, boolean ivfDefinitive, Unit unit)
          Construct a new ellipsoid using the specified axis length.
private Ellipsoid(java.lang.String name, double semiMajorAxis, double semiMinorAxis, double inverseFlattening, boolean ivfDefinitive, Unit unit)
          Construct a new ellipsoid using the specified axis length.
  Ellipsoid(java.lang.String name, double semiMajorAxis, double semiMinorAxis, Unit unit)
          Construct a new ellipsoid using the specified axis length.
  Ellipsoid(java.lang.String name, double radius, Unit unit)
          Construct a new sphere using the specified radius.
 
Method Summary
(package private)  java.lang.String addString(java.lang.StringBuffer buffer)
          Fill the part inside "[...]".
private static double check(java.lang.String name, double value)
          Check the argument validity.
static Ellipsoid createFlattenedSphere(java.lang.String name, double semiMajorAxis, double inverseFlattening, Unit unit)
          Construct a new ellipsoid using the specified axis length and inverse flattening value.
 boolean equals(java.lang.Object object)
          Compares the specified object with this ellipsoid for equality.
 Unit getAxisUnit()
          Returns the units of the semi-major and semi-minor axis values.
 double getEccentricity()
          The ratio of the distance between the center and a focus of the ellipse to the length of its semimajor axis.
 double getInverseFlattening()
          Returns the value of the inverse of the flattening constant.
 double getSemiMajorAxis()
          Gets the equatorial radius.
 double getSemiMinorAxis()
          Gets the polar radius.
 int hashCode()
          Returns a hash value for this ellipsoid.
 boolean isIvfDefinitive()
          Is the Inverse Flattening definitive for this ellipsoid?
 double orthodromicDistance(double x1, double y1, double x2, double y2)
          Returns an estimation of orthodromic distance between two geographic coordinates.
 double orthodromicDistance(java.awt.geom.Point2D P1, java.awt.geom.Point2D P2)
          Returns an estimation of orthodromic distance between two geographic coordinates.
(package private)  java.lang.Object toOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this ellipsoid.
 
Methods inherited from class org.deegree_impl.model.cs.Info
addUnit, cachedOpenGIS, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, getAbbreviation, getAlias, getAuthority, getAuthorityCode, getName, getRemarks, readResolve, toString
 
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

WGS84

public static final Ellipsoid WGS84
WGS 1984 ellipsoid. This ellipsoid is used in GPS system and is the default for most org.deegree_impl.model packages.


semiMajorAxis

private final double semiMajorAxis
The equatorial radius.


semiMinorAxis

private final double semiMinorAxis
The polar radius.


inverseFlattening

private final double inverseFlattening
The inverse of the flattening value, or Double.POSITIVE_INFINITY if the ellipsoid is a sphere.


ivfDefinitive

private final boolean ivfDefinitive
Is the Inverse Flattening definitive for this ellipsoid?


unit

private final Unit unit
The units of the semi-major and semi-minor axis values.

Constructor Detail

Ellipsoid

public Ellipsoid(java.lang.String name,
                 double radius,
                 Unit unit)
Construct a new sphere using the specified radius.

Parameters:
name - Name of this sphere.
radius - The equatorial and polar radius.
unit - The units of the semi-major and semi-minor axis values.

Ellipsoid

public Ellipsoid(java.lang.String name,
                 double semiMajorAxis,
                 double semiMinorAxis,
                 Unit unit)
Construct a new ellipsoid using the specified axis length.

Parameters:
name - Name of this ellipsoid.
semiMajorAxis - The equatorial radius.
semiMinorAxis - The polar radius.
unit - The units of the semi-major and semi-minor axis values.

Ellipsoid

private Ellipsoid(java.lang.String name,
                  double semiMajorAxis,
                  double semiMinorAxis,
                  double inverseFlattening,
                  boolean ivfDefinitive,
                  Unit unit)
Construct a new ellipsoid using the specified axis length.

Parameters:
name - Name of this ellipsoid.
semiMajorAxis - The equatorial radius.
semiMinorAxis - The polar radius.
inverseFlattening - The inverse of the flattening value.
ivfDefinitive - Is the Inverse Flattening definitive for this ellipsoid?
unit - The units of the semi-major and semi-minor axis values.

Ellipsoid

Ellipsoid(java.util.Map properties,
          double semiMajorAxis,
          double semiMinorAxis,
          double inverseFlattening,
          boolean ivfDefinitive,
          Unit unit)
Construct a new ellipsoid using the specified axis length.

Parameters:
properties - The set of properties (see Info).
semiMajorAxis - The equatorial radius.
semiMinorAxis - The polar radius.
inverseFlattening - The inverse of the flattening value.
ivfDefinitive - Is the Inverse Flattening definitive for this ellipsoid?
unit - The units of the semi-major and semi-minor axis values.
Method Detail

createFlattenedSphere

public static Ellipsoid createFlattenedSphere(java.lang.String name,
                                              double semiMajorAxis,
                                              double inverseFlattening,
                                              Unit unit)
Construct a new ellipsoid using the specified axis length and inverse flattening value.

Parameters:
name - Name of this ellipsoid.
semiMajorAxis - The equatorial radius.
inverseFlattening - The inverse flattening value.
unit - The units of the semi-major and semi-minor axis values.

check

private static double check(java.lang.String name,
                            double value)
                     throws java.lang.IllegalArgumentException
Check the argument validity. Argument value should be greater than zero.

Parameters:
name - Argument name.
value - Argument value.
Returns:
value.
Throws:
java.lang.IllegalArgumentException - if value is not greater than 0.

getSemiMajorAxis

public double getSemiMajorAxis()
Gets the equatorial radius. The returned length is expressed in this object's axis units.

See Also:
CS_Ellipsoid.getSemiMajorAxis()

getSemiMinorAxis

public double getSemiMinorAxis()
Gets the polar radius. The returned length is expressed in this object's axis units.

See Also:
CS_Ellipsoid.getSemiMinorAxis()

getEccentricity

public double getEccentricity()
The ratio of the distance between the center and a focus of the ellipse to the length of its semimajor axis. The eccentricity can alternately be computed from the equation: e=sqrt(2f-f²).


getInverseFlattening

public double getInverseFlattening()
Returns the value of the inverse of the flattening constant. Flattening is a value used to indicate how closely an ellipsoid approaches a spherical shape. The inverse flattening is related to the equatorial/polar radius (re and rp respectively) by the formula ivf=re/(re-rp). For perfect spheres, this method returns Double.POSITIVE_INFINITY (which is the correct value).

See Also:
CS_Ellipsoid.getInverseFlattening()

isIvfDefinitive

public boolean isIvfDefinitive()
Is the Inverse Flattening definitive for this ellipsoid? Some ellipsoids use the IVF as the defining value, and calculate the polar radius whenever asked. Other ellipsoids use the polar radius to calculate the IVF whenever asked. This distinction can be important to avoid floating-point rounding errors.


orthodromicDistance

public double orthodromicDistance(java.awt.geom.Point2D P1,
                                  java.awt.geom.Point2D P2)
Returns an estimation of orthodromic distance between two geographic coordinates. The orthodromic distance is the shortest distance between two points on a sphere's surface. The orthodromic path is always on a great circle. An other possible distance measurement is the loxodromic distance, which is a longer distance on a path with a constant direction on the compas.

Parameters:
P1 - Longitude and latitude of first point (in degrees).
P2 - Longitude and latitude of second point (in degrees).
Returns:
The orthodromic distance (in the units of this ellipsoid).

orthodromicDistance

public double orthodromicDistance(double x1,
                                  double y1,
                                  double x2,
                                  double y2)
Returns an estimation of orthodromic distance between two geographic coordinates. The orthodromic distance is the shortest distance between two points on a sphere's surface. The orthodromic path is always on a great circle. An other possible distance measurement is the loxodromic distance, which is a longer distance on a path with a constant direction on the compas.

Parameters:
x1 - Longitude of first point (in degrees).
y1 - Latitude of first point (in degrees).
x2 - Longitude of second point (in degrees).
y2 - Latitude of second point (in degrees).
Returns:
The orthodromic distance (in the units of this ellipsoid).

getAxisUnit

public Unit getAxisUnit()
Returns the units of the semi-major and semi-minor axis values.

See Also:
CS_Ellipsoid.getAxisUnit()

equals

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

Overrides:
equals in class Info

hashCode

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

Overrides:
hashCode in class Info

addString

java.lang.String addString(java.lang.StringBuffer buffer)
Fill the part inside "[...]". Used for formatting Well Know Text (WKT).

Overrides:
addString in class Info
Parameters:
buffer - The buffer to add string to.
Returns:
The WKT code name (e.g. "GEOGCS").

toOpenGIS

final java.lang.Object toOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this ellipsoid. The returned object is suitable for RMI use. Note: The returned type is a generic Object in order to avoid too early class loading of OpenGIS interface.

Overrides:
toOpenGIS in class Info