Package org.opengis.example.referencing
Class SimpleDatum
- Object
-
- SimpleIdentifiedObject
-
- SimpleDatum
-
- All Implemented Interfaces:
Serializable,Identifier,Datum,Ellipsoid,GeodeticDatum,IdentifiedObject,ReferenceIdentifier
public class SimpleDatum extends SimpleIdentifiedObject implements GeodeticDatum, Ellipsoid
AGeodeticDatumusing the Greenwich prime meridian. This class does not make distinction between Geodetic Datum and Ellipsoid, so we implement the two interfaces by the same class.- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleinverseFlatteningThe inverse flattening factor.protected doublesemiMajorAxisThe semi-major axis length, in metres.static GeodeticDatumSPHEREA spherical datum used for coordinate reference systems where datum is unknown.static GeodeticDatumWGS84The WGS84 datum.-
Fields inherited from class SimpleIdentifiedObject
authority, code
-
Fields inherited from interface Datum
ANCHOR_POINT_KEY, DOMAIN_OF_VALIDITY_KEY, REALIZATION_EPOCH_KEY, SCOPE_KEY
-
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Fields inherited from interface Identifier
AUTHORITY_KEY, CODE_KEY, CODESPACE_KEY, DESCRIPTION_KEY, VERSION_KEY
-
-
Constructor Summary
Constructors Constructor Description SimpleDatum(Citation authority, String name, double semiMajorAxis, double inverseFlattening)Creates a new geodetic datum for the given authority, name, and ellipsoid axis length.
-
Method Summary
Modifier and Type Method Description booleanequals(Object object)Compares this datum with the given object for equality.Unit<Length>getAxisUnit()Returns the linear unit of the semi-major and semi-minor axis values.EllipsoidgetEllipsoid()Returns the ellipsoid, which is represented directly bythisimplementation class since it does not distinguish geodetic datum and ellipsoid.doublegetInverseFlattening()Returns the value of the inverse of the flattening constant.PrimeMeridiangetPrimeMeridian()Returns the prime meridian.doublegetSemiMajorAxis()Length of the semi-major axis of the ellipsoid.doublegetSemiMinorAxis()Length of the semi-minor axis of the ellipsoid.booleanisIvfDefinitive()Indicates if the inverse flattening is definitive for this ellipsoid.booleanisSphere()trueif the ellipsoid is degenerate and is actually a sphere.-
Methods inherited from class SimpleIdentifiedObject
getAuthority, getCode, getCodeSpace, getDomainOfValidity, getName, getScope, hashCode, toString, toWKT
-
Methods inherited from interface Datum
getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScope
-
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Methods inherited from interface Identifier
getDescription, getVersion
-
-
-
-
Field Detail
-
WGS84
public static final GeodeticDatum WGS84
The WGS84 datum. The semi major axis length is 6378137.0 metres and the inverse flattening factor is 298.257223563.
-
SPHERE
public static final GeodeticDatum SPHERE
A spherical datum used for coordinate reference systems where datum is unknown. The axis length are 6371007 metres.
-
semiMajorAxis
protected final double semiMajorAxis
The semi-major axis length, in metres.- See Also:
getSemiMajorAxis()
-
inverseFlattening
protected final double inverseFlattening
The inverse flattening factor.- See Also:
getInverseFlattening()
-
-
Constructor Detail
-
SimpleDatum
public SimpleDatum(Citation authority, String name, double semiMajorAxis, double inverseFlattening)
Creates a new geodetic datum for the given authority, name, and ellipsoid axis length.- Parameters:
authority- organization responsible for definition of the name, ornull.name- the name of the new CRS.semiMajorAxis- the value to be returned bygetSemiMajorAxis(), in metres.inverseFlattening- the value to be returned bygetInverseFlattening().
-
-
Method Detail
-
getEllipsoid
public Ellipsoid getEllipsoid()
Returns the ellipsoid, which is represented directly bythisimplementation class since it does not distinguish geodetic datum and ellipsoid.- Specified by:
getEllipsoidin interfaceGeodeticDatum- Returns:
- the ellipsoid.
-
getAxisUnit
public Unit<Length> getAxisUnit()
Returns the linear unit of the semi-major and semi-minor axis values. The default implementation returnsUnits.METRE.- Specified by:
getAxisUnitin interfaceEllipsoid- Returns:
- the axis linear unit.
-
getSemiMajorAxis
public double getSemiMajorAxis()
Length of the semi-major axis of the ellipsoid. This is the equatorial radius in axis linear unit.- Specified by:
getSemiMajorAxisin interfaceEllipsoid- Returns:
- Length of semi-major axis.
-
getSemiMinorAxis
public double getSemiMinorAxis()
Length of the semi-minor axis of the ellipsoid. This is the polar radius in axis linear unit.- Specified by:
getSemiMinorAxisin interfaceEllipsoid- Returns:
- Length of semi-minor axis.
-
getInverseFlattening
public double getInverseFlattening()
Returns the value of the inverse of the flattening constant.- Specified by:
getInverseFlatteningin interfaceEllipsoid- Returns:
- the inverse flattening value, or positive infinity if this ellipsoid is a sphere.
-
isIvfDefinitive
public boolean isIvfDefinitive()
Indicates if the inverse flattening is definitive for this ellipsoid. The default implementation returnstruefor if this ellipsoid is not a sphere, since the constructor of thisSimpleDatumclass expects ainverseFlatteningvalue.- Specified by:
isIvfDefinitivein interfaceEllipsoid- Returns:
trueif the inverse flattening is definitive, orfalseif the polar radius is definitive.
-
isSphere
public boolean isSphere()
trueif the ellipsoid is degenerate and is actually a sphere.
-
getPrimeMeridian
public PrimeMeridian getPrimeMeridian()
Returns the prime meridian. The default implementation returns the Greenwich prime meridian.- Specified by:
getPrimeMeridianin interfaceGeodeticDatum- Returns:
- the prime meridian.
-
equals
public boolean equals(Object object)
Compares this datum with the given object for equality.- Overrides:
equalsin classSimpleIdentifiedObject- Parameters:
object- The object to compare with thisSimpleDatum.- Returns:
trueif the given object is equals to this object.
-
-