public class DefaultEllipsoid extends AbstractIdentifiedObject implements Ellipsoid
orthodromicDistance(double, double, double, double)
convenience method
for calculating distances on great circles.
Choice 1 in the following list is the easiest but most restrictive way to get an ellipsoid. The other choices provide more freedom. Each choice delegates its work to the subsequent items (in the default configuration), so this list can been seen as top to bottom API.
Ellipsoid
from one of the static convenience shortcuts listed in
CommonCRS.ellipsoid()
.Ellipsoid
from an identifier in a database by invoking
DatumAuthorityFactory.createEllipsoid(String)
.Ellipsoid
by invoking the DatumFactory.createEllipsoid(…)
or createFlattenedSphere(…)
method (implemented for example by GeodeticObjectFactory
).DefaultEllipsoid
by invoking the
createEllipsoid(…)
or
createFlattenedSphere(…)
static methods defined in this class.Ellipsoid e = CommonCRS.WGS84.ellipsoid();
CommonCRS.ellipsoid()
,
Serialized FormDefined in the sis-referencing
module
DEPRECATED_KEY, LOCALE_KEY
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Modifier | Constructor and Description |
---|---|
protected |
DefaultEllipsoid(Ellipsoid ellipsoid)
Creates a new ellipsoid with the same values than the specified one.
|
protected |
DefaultEllipsoid(Map<String,?> properties,
double semiMajorAxis,
double semiMinorAxis,
double inverseFlattening,
boolean ivfDefinitive,
Unit<Length> unit)
Creates a new ellipsoid using the specified axis length.
|
Modifier and Type | Method and Description |
---|---|
static DefaultEllipsoid |
castOrCopy(Ellipsoid object)
Returns a SIS ellipsoid implementation with the same values than the given arbitrary implementation.
|
protected long |
computeHashCode()
Invoked by
hashCode() for computing the hash code when first needed. |
static DefaultEllipsoid |
createEllipsoid(Map<String,?> properties,
double semiMajorAxis,
double semiMinorAxis,
Unit<Length> unit)
Creates a new ellipsoid using the specified properties and axis length.
|
static DefaultEllipsoid |
createFlattenedSphere(Map<String,?> properties,
double semiMajorAxis,
double inverseFlattening,
Unit<Length> unit)
Creates a new ellipsoid using the specified properties, axis length and inverse flattening value.
|
boolean |
equals(Object object,
ComparisonMode mode)
Compares this ellipsoid with the specified object for equality.
|
protected String |
formatTo(Formatter formatter)
Formats this ellipsoid as a Well Known Text
Ellipsoid[…] element. |
double |
getAuthalicRadius()
Returns the radius of a hypothetical sphere having the same surface than this ellipsoid.
|
Unit<Length> |
getAxisUnit()
Returns the linear unit 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 semi-major axis.
|
Class<? extends Ellipsoid> |
getInterface()
Returns the GeoAPI interface implemented by this class.
|
double |
getInverseFlattening()
Returns the value of the inverse of the flattening constant.
|
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. |
double |
orthodromicDistance(double λ1,
double φ1,
double λ2,
double φ2)
Returns the orthodromic distance between two geographic coordinates.
|
castOrCopy, equals, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
print, toString, toString, toWKT
getAlias, getIdentifiers, getName, getRemarks, toWKT
protected DefaultEllipsoid(Map<String,?> properties, double semiMajorAxis, double semiMinorAxis, double inverseFlattening, boolean ivfDefinitive, Unit<Length> unit)
Property name | Value type | Returned by |
---|---|---|
"name" | ReferenceIdentifier or String |
AbstractIdentifiedObject.getName() |
"alias" | GenericName or CharSequence (optionally as array) |
AbstractIdentifiedObject.getAlias() |
"identifiers" | ReferenceIdentifier (optionally as array) |
AbstractIdentifiedObject.getIdentifiers() |
"remarks" | InternationalString or String |
AbstractIdentifiedObject.getRemarks() |
properties
- The properties to be given to the identified object.semiMajorAxis
- The equatorial radius.semiMinorAxis
- The polar radius.inverseFlattening
- The inverse of the flattening value.ivfDefinitive
- true
if the inverse flattening is definitive.unit
- The units of the semi-major and semi-minor axis values.createEllipsoid(Map, double, double, Unit)
,
createFlattenedSphere(Map, double, double, Unit)
protected DefaultEllipsoid(Ellipsoid ellipsoid)
This constructor performs a shallow copy, i.e. the properties are not cloned.
ellipsoid
- The ellipsoid to copy.castOrCopy(Ellipsoid)
public static DefaultEllipsoid createEllipsoid(Map<String,?> properties, double semiMajorAxis, double semiMinorAxis, Unit<Length> unit)
properties
- The properties to be given to the identified object.semiMajorAxis
- The equatorial radius in the given unit.semiMinorAxis
- The polar radius in the given unit.unit
- The units of the semi-major and semi-minor axis values.public static DefaultEllipsoid createFlattenedSphere(Map<String,?> properties, double semiMajorAxis, double inverseFlattening, Unit<Length> unit)
properties
- The properties to be given to the identified object.semiMajorAxis
- The equatorial radius in the given unit.inverseFlattening
- The inverse flattening value.unit
- The units of the semi-major and semi-minor axis values.public static DefaultEllipsoid castOrCopy(Ellipsoid object)
null
, then this method returns null
.
Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.object
- The object to get as a SIS implementation, or null
if none.null
if the argument was null.public Class<? extends Ellipsoid> getInterface()
Ellipsoid.class
.
Ellipsoid
sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with
their own set of interfaces.getInterface
in class AbstractIdentifiedObject
Ellipsoid.class
or a user-defined sub-interface.public Unit<Length> getAxisUnit()
getAxisUnit
in interface Ellipsoid
public double getSemiMajorAxis()
getSemiMajorAxis
in interface Ellipsoid
public double getSemiMinorAxis()
getSemiMinorAxis
in interface Ellipsoid
public double getAuthalicRadius()
CommonCRS.SPHERE
public double getEccentricity()
e = sqrt(2f - f²)
.public double getInverseFlattening()
ivf = re / (re - rp).For perfect spheres (i.e. if
isSphere()
returns true
),
the Double.POSITIVE_INFINITY
value is used.getInverseFlattening
in interface Ellipsoid
public boolean isIvfDefinitive()
isIvfDefinitive
in interface Ellipsoid
true
if the inverse flattening is definitive,
or false
if the polar radius is definitive.public boolean isSphere()
true
if the ellipsoid is degenerate and is actually a sphere.
The sphere is completely defined by the semi-major axis,
which is the radius of the sphere.public double orthodromicDistance(double λ1, double φ1, double λ2, double φ2)
λ1
- Longitude of first point (in decimal degrees).φ1
- Latitude of first point (in decimal degrees).λ2
- Longitude of second point (in decimal degrees).φ2
- Latitude of second point (in decimal degrees).public boolean equals(Object object, ComparisonMode mode)
equals
in interface LenientComparable
equals
in class AbstractIdentifiedObject
object
- The object to compare to this
.mode
- STRICT
for performing a strict comparison, or
IGNORE_METADATA
for comparing only properties
relevant to coordinate transformations.true
if both objects are equal.AbstractIdentifiedObject.computeHashCode()
,
Utilities.deepEquals(Object, Object, ComparisonMode)
protected long computeHashCode()
hashCode()
for computing the hash code when first needed.
See AbstractIdentifiedObject.computeHashCode()
for more information.computeHashCode
in class AbstractIdentifiedObject
protected String formatTo(Formatter formatter)
Ellipsoid[…]
element.formatTo
in class AbstractIdentifiedObject
formatter
- The formatter where to format the inner content of this WKT element."Ellipsoid"
(WKT 2) or "Spheroid"
(WKT 1).Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.