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
AGeodeticDatum
using 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 double
inverseFlattening
The inverse flattening factor.protected double
semiMajorAxis
The semi-major axis length, in metres.static GeodeticDatum
SPHERE
A spherical datum used for coordinate reference systems where datum is unknown.static GeodeticDatum
WGS84
The 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 boolean
equals(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.Ellipsoid
getEllipsoid()
Returns the ellipsoid, which is represented directly bythis
implementation class since it does not distinguish geodetic datum and ellipsoid.double
getInverseFlattening()
Returns the value of the inverse of the flattening constant.PrimeMeridian
getPrimeMeridian()
Returns the prime meridian.double
getSemiMajorAxis()
Length of the semi-major axis of the ellipsoid.double
getSemiMinorAxis()
Length of the semi-minor axis of the ellipsoid.boolean
isIvfDefinitive()
Indicates if the inverse flattening is definitive for this ellipsoid.boolean
isSphere()
true
if 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 bythis
implementation class since it does not distinguish geodetic datum and ellipsoid.- Specified by:
getEllipsoid
in 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:
getAxisUnit
in 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:
getSemiMajorAxis
in 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:
getSemiMinorAxis
in interfaceEllipsoid
- Returns:
- Length of semi-minor axis.
-
getInverseFlattening
public double getInverseFlattening()
Returns the value of the inverse of the flattening constant.- Specified by:
getInverseFlattening
in 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 returnstrue
for if this ellipsoid is not a sphere, since the constructor of thisSimpleDatum
class expects ainverseFlattening
value.- Specified by:
isIvfDefinitive
in interfaceEllipsoid
- Returns:
true
if the inverse flattening is definitive, orfalse
if the polar radius is definitive.
-
isSphere
public boolean isSphere()
true
if 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:
getPrimeMeridian
in interfaceGeodeticDatum
- Returns:
- the prime meridian.
-
equals
public boolean equals(Object object)
Compares this datum with the given object for equality.- Overrides:
equals
in classSimpleIdentifiedObject
- Parameters:
object
- The object to compare with thisSimpleDatum
.- Returns:
true
if the given object is equals to this object.
-
-