org.deegree.cs.components
Class Ellipsoid

java.lang.Object
  extended by org.deegree.cs.CRSIdentifiable
      extended by org.deegree.cs.components.Ellipsoid
All Implemented Interfaces:
Object, TypedObjectNode, IEllipsoid, CRSResource

public class Ellipsoid
extends CRSIdentifiable
implements IEllipsoid

The Ellipsoid class hold all parameters which are necessary to define an Ellipsoid. Every Ellipsoid has a semi-major-axis and one of inverse_flattening, eccentricity or semi-minor-axis.

Version:
$Revision: 30120 $, $Date: 2011-03-22 10:04:15 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Field Summary
static Ellipsoid WGS84
          WGS 1984 ellipsoid.
 
Constructor Summary
Ellipsoid(double semiMajorAxis, double eccentricity, IUnit units, CRSCodeType[] codes)
           
Ellipsoid(double semiMajorAxis, double eccentricity, IUnit units, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
Ellipsoid(double semiMajorAxis, double eccentricity, IUnit units, CRSCodeType code, String name)
           
Ellipsoid(double semiMajorAxis, double eccentricity, IUnit units, CRSCodeType code, String name, String version, String description, String areaOfUse)
           
Ellipsoid(double semiMajorAxis, double eccentricity, IUnit units, CRSResource id)
           
Ellipsoid(double semiMajorAxis, IUnit units, double inverseFlattening, CRSCodeType[] codes)
           
Ellipsoid(double semiMajorAxis, IUnit units, double inverseFlattening, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
Ellipsoid(double semiMajorAxis, IUnit units, double inverseFlattening, CRSCodeType code, String name)
           
Ellipsoid(double semiMajorAxis, IUnit units, double inverseFlattening, CRSCodeType code, String name, String version, String description, String areaOfUse)
           
Ellipsoid(double semiMajorAxis, IUnit units, double inverseFlattening, CRSResource id)
           
Ellipsoid(IUnit units, double semiMajorAxis, double semiMinorAxis, CRSCodeType[] codes)
           
Ellipsoid(IUnit units, double semiMajorAxis, double semiMinorAxis, CRSCodeType[] codes, String[] names, String[] versions, String[] descriptions, String[] areasOfUse)
           
Ellipsoid(IUnit units, double semiMajorAxis, double semiMinorAxis, CRSCodeType code, String name)
           
Ellipsoid(IUnit units, double semiMajorAxis, double semiMinorAxis, CRSCodeType code, String name, String version, String description, String areaOfUse)
           
Ellipsoid(IUnit units, double semiMajorAxis, double semiMinorAxis, CRSResource id)
           
 
Method Summary
 boolean equals(Object other)
           
 double getEccentricity()
           
 double getFlattening()
           
 double getInverseFlattening()
           
 double getSemiMajorAxis()
           
 double getSemiMinorAxis()
           
 double getSquaredEccentricity()
           
 IUnit getUnits()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 boolean isSphere()
           
 void setUnits(IUnit units)
           
 String toString()
           
 
Methods inherited from class org.deegree.cs.CRSIdentifiable
addAreaOfUse, addName, checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getId, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.cs.CRSResource
addAreaOfUse, addName, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion
 
Methods inherited from interface org.deegree.commons.tom.Object
getId
 

Field Detail

WGS84

public static final Ellipsoid WGS84
WGS 1984 ellipsoid. This ellipsoid is used in the GPS system and is the "default" Ellipsoid.

Constructor Detail

Ellipsoid

public Ellipsoid(IUnit units,
                 double semiMajorAxis,
                 double semiMinorAxis,
                 CRSResource id)
Parameters:
units -
semiMajorAxis -
semiMinorAxis -
id - containing the relevant information

Ellipsoid

public Ellipsoid(IUnit units,
                 double semiMajorAxis,
                 double semiMinorAxis,
                 CRSCodeType[] codes,
                 String[] names,
                 String[] versions,
                 String[] descriptions,
                 String[] areasOfUse)
Parameters:
units -
semiMajorAxis -
semiMinorAxis -
codes -
names -
versions -
descriptions -
areasOfUse -

Ellipsoid

public Ellipsoid(IUnit units,
                 double semiMajorAxis,
                 double semiMinorAxis,
                 CRSCodeType code,
                 String name,
                 String version,
                 String description,
                 String areaOfUse)
Parameters:
units -
semiMajorAxis -
semiMinorAxis -
code -
name -
version -
description -
areaOfUse -

Ellipsoid

public Ellipsoid(IUnit units,
                 double semiMajorAxis,
                 double semiMinorAxis,
                 CRSCodeType[] codes)
Parameters:
units -
semiMajorAxis -
semiMinorAxis -
codes -

Ellipsoid

public Ellipsoid(IUnit units,
                 double semiMajorAxis,
                 double semiMinorAxis,
                 CRSCodeType code,
                 String name)
Parameters:
units -
semiMajorAxis -
semiMinorAxis -
code -
name -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 IUnit units,
                 double inverseFlattening,
                 CRSResource id)
Parameters:
semiMajorAxis -
units -
inverseFlattening -
id - containing all id relevant data.

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 IUnit units,
                 double inverseFlattening,
                 CRSCodeType[] codes,
                 String[] names,
                 String[] versions,
                 String[] descriptions,
                 String[] areasOfUse)
Parameters:
semiMajorAxis -
units -
inverseFlattening -
codes -
names -
versions -
descriptions -
areasOfUse -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 IUnit units,
                 double inverseFlattening,
                 CRSCodeType code,
                 String name,
                 String version,
                 String description,
                 String areaOfUse)
Parameters:
semiMajorAxis -
units -
inverseFlattening -
code -
name -
version -
description -
areaOfUse -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 IUnit units,
                 double inverseFlattening,
                 CRSCodeType[] codes)
Parameters:
semiMajorAxis -
units -
inverseFlattening -
codes -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 IUnit units,
                 double inverseFlattening,
                 CRSCodeType code,
                 String name)
Parameters:
semiMajorAxis -
units -
inverseFlattening -
code -
name -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 double eccentricity,
                 IUnit units,
                 CRSResource id)
Parameters:
semiMajorAxis -
eccentricity -
units -
id - containing all id relevant data.

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 double eccentricity,
                 IUnit units,
                 CRSCodeType[] codes,
                 String[] names,
                 String[] versions,
                 String[] descriptions,
                 String[] areasOfUse)
Parameters:
semiMajorAxis -
eccentricity -
units -
codes -
names -
versions -
descriptions -
areasOfUse -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 double eccentricity,
                 IUnit units,
                 CRSCodeType code,
                 String name,
                 String version,
                 String description,
                 String areaOfUse)
Parameters:
semiMajorAxis -
eccentricity -
units -
code -
name -
version -
description -
areaOfUse -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 double eccentricity,
                 IUnit units,
                 CRSCodeType[] codes)
Parameters:
semiMajorAxis -
eccentricity -
units -
codes -

Ellipsoid

public Ellipsoid(double semiMajorAxis,
                 double eccentricity,
                 IUnit units,
                 CRSCodeType code,
                 String name)
Parameters:
semiMajorAxis -
eccentricity -
units -
code -
name -
Method Detail

getEccentricity

public final double getEccentricity()
Specified by:
getEccentricity in interface IEllipsoid
Returns:
the eccentricity.

getSquaredEccentricity

public final double getSquaredEccentricity()
Specified by:
getSquaredEccentricity in interface IEllipsoid
Returns:
the squared eccentricity of the ellipsoid-

getFlattening

public final double getFlattening()
Specified by:
getFlattening in interface IEllipsoid
Returns:
the flattening.

getInverseFlattening

public final double getInverseFlattening()
Specified by:
getInverseFlattening in interface IEllipsoid
Returns:
the inverseFlattening.

getSemiMajorAxis

public final double getSemiMajorAxis()
Specified by:
getSemiMajorAxis in interface IEllipsoid
Returns:
the semiMajorAxis.

getSemiMinorAxis

public final double getSemiMinorAxis()
Specified by:
getSemiMinorAxis in interface IEllipsoid
Returns:
the semiMinorAxis.

getUnits

public final IUnit getUnits()
Specified by:
getUnits in interface IEllipsoid
Returns:
the units.

setUnits

public final void setUnits(IUnit units)
Specified by:
setUnits in interface IEllipsoid
Parameters:
units -

equals

public boolean equals(Object other)
Overrides:
equals in class CRSIdentifiable
Parameters:
other - another ellipsoid
Returns:
true if the other ellipsoid != null and its units, semi-major-axis and eccentricity are the same.

toString

public String toString()
Overrides:
toString in class CRSIdentifiable

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class CRSIdentifiable
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

isSphere

public boolean isSphere()
Specified by:
isSphere in interface IEllipsoid
Returns:
true if this ellipsoid has no eccentricity.


Copyright © 2011. All Rights Reserved.