public class DefaultGeodeticDatum extends AbstractDatum implements GeodeticDatum
BursaWolfParameters
can optionally be associated to each DefaultGeodeticDatum
instance.
This association is not part of the ISO 19111 model, but still a common practice (especially in older standards).
Associating Bursa-Wolf parameters to geodetic datum is known as the early-binding approach.
A recommended alternative, discussed below, is the late-binding approach.
There is different methods for transforming coordinates from one geodetic datum to an other datum, and Bursa-Wolf parameters are used with some of them. However different set of parameters may exist for the same pair of (source, target) datum, so it is often not sufficient to know those datum. The (source, target) pair of CRS are often necessary, sometime together with the geographic extent of the coordinates to transform.
Apache SIS searches for datum shift methods (including Bursa-Wolf parameters) in the EPSG database when a
CoordinateOperation
or a
MathTransform
is requested for a pair of CRS.
This is known as the late-binding approach.
If a datum shift method is found in the database, it will have precedence over any BursaWolfParameters
instance associated to this DefaultGeodeticDatum
. Only if no datum shift method is found in the database,
then the BursaWolfParameters
associated to the datum may be used as a fallback.
The Bursa-Wolf parameters association serves an other purpose: when a CRS is formatted in the older
Well Known Text (WKT 1) format, the formatted string may contain a TOWGS84[…]
element
with the parameter values of the transformation to the WGS 84 datum. This element is provided as a help
for other Geographic Information Systems that support only the early-binding approach.
Apache SIS usually does not need the TOWGS84
element, except as a fallback for datum that
do not exist in the EPSG database.
GeodeticDatum
from one of the static convenience shortcuts listed in
CommonCRS.datum()
.GeodeticDatum
from an identifier in a database by invoking
DatumAuthorityFactory.createGeodeticDatum(String)
.GeodeticDatum
by invoking the createGeodeticDatum(…)
method defined in the DatumFactory
interface.DefaultGeodeticDatum
by invoking the
constructor
.GeodeticDatum datum = CommonCRS.WGS84.datum();
Ellipsoid
and the PrimeMeridian
given to the constructor are also immutable. Unless otherwise
noted in the javadoc, this condition holds if all components were created using only SIS factories and static
constants.DefaultEllipsoid
,
DefaultPrimeMeridian
,
CommonCRS.datum()
,
Serialized FormDefined in the sis-referencing
module
Modifier and Type | Field and Description |
---|---|
static String |
BURSA_WOLF_KEY
The
"bursaWolf" property for
Bursa-Wolf parameters. |
LOCALE_KEY
ANCHOR_POINT_KEY, DOMAIN_OF_VALIDITY_KEY, REALIZATION_EPOCH_KEY, SCOPE_KEY
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Modifier | Constructor and Description |
---|---|
protected |
DefaultGeodeticDatum(GeodeticDatum datum)
Creates a new datum with the same values than the specified one.
|
|
DefaultGeodeticDatum(Map<String,?> properties,
Ellipsoid ellipsoid,
PrimeMeridian primeMeridian)
Creates a geodetic datum from the given properties.
|
Modifier and Type | Method and Description |
---|---|
static DefaultGeodeticDatum |
castOrCopy(GeodeticDatum object)
Returns a SIS datum implementation with the same values than the given arbitrary implementation.
|
protected long |
computeHashCode()
Invoked by
hashCode() for computing the hash code when first needed. |
boolean |
equals(Object object,
ComparisonMode mode)
Compare this datum with the specified object for equality.
|
protected String |
formatTo(Formatter formatter)
Formats this datum as a Well Known Text
Datum[…] element. |
BursaWolfParameters[] |
getBursaWolfParameters()
Returns all Bursa-Wolf parameters specified in the
properties map at construction time. |
Ellipsoid |
getEllipsoid()
Returns the ellipsoid given at construction time.
|
Class<? extends GeodeticDatum> |
getInterface()
Returns the GeoAPI interface implemented by this class.
|
Matrix |
getPositionVectorTransformation(GeodeticDatum targetDatum,
Extent areaOfInterest)
Returns the position vector transformation (geocentric domain) to the specified datum.
|
PrimeMeridian |
getPrimeMeridian()
Returns the prime meridian given at construction time.
|
castOrCopy, getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScope, isHeuristicMatchForName
castOrCopy, equals, getAlias, getIdentifiers, getName, getRemarks, hashCode, isDeprecated
print, toString, toString, toWKT
getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScope
getAlias, getIdentifiers, getName, getRemarks, toWKT
public static final String BURSA_WOLF_KEY
"bursaWolf"
property for
Bursa-Wolf parameters.public DefaultGeodeticDatum(Map<String,?> properties, Ellipsoid ellipsoid, PrimeMeridian primeMeridian)
Property name | Value type | Returned by |
---|---|---|
"bursaWolf" | BursaWolfParameters (optionally as array) |
getBursaWolfParameters() |
Defined in parent classes (reminder) | ||
"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() |
"anchorPoint" | InternationalString or String |
AbstractDatum.getAnchorPoint() |
"realizationEpoch" | Date |
AbstractDatum.getRealizationEpoch() |
"domainOfValidity" | Extent |
AbstractDatum.getDomainOfValidity() |
"scope" | InternationalString or String |
AbstractDatum.getScope() |
properties
- The properties to be given to the identified object.ellipsoid
- The ellipsoid.primeMeridian
- The prime meridian.protected DefaultGeodeticDatum(GeodeticDatum datum)
This constructor performs a shallow copy, i.e. the properties are not cloned.
datum
- The datum to copy.castOrCopy(GeodeticDatum)
public static DefaultGeodeticDatum castOrCopy(GeodeticDatum 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 GeodeticDatum> getInterface()
GeodeticDatum.class
.
GeodeticDatum
sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their
own set of interfaces.getInterface
in class AbstractDatum
GeodeticDatum.class
or a user-defined sub-interface.public Ellipsoid getEllipsoid()
getEllipsoid
in interface GeodeticDatum
public PrimeMeridian getPrimeMeridian()
getPrimeMeridian
in interface GeodeticDatum
public BursaWolfParameters[] getBursaWolfParameters()
properties
map at construction time.
For a discussion about what Bursa-Wolf parameters are, see the class javadoc.public Matrix getPositionVectorTransformation(GeodeticDatum targetDatum, Extent areaOfInterest)
GeodeticDatum
contains BursaWolfParameters
having the given
target datum (ignoring metadata),
then the matrix will be built from those parameters.BursaWolfParameters
having this datum
as their target (ignoring metadata), then the matrix will be built from those parameters
and inverted.null
.BursaWolfParameters
instance is found in any of the above steps, then the one having
the largest intersection between its domain of validity
and the given extent will be selected. If more than one instance have the same intersection, then the first
occurrence is selected.
If the given extent contains a temporal extent, then the instant located midway between start and end time will be taken as the date where to evaluate the Bursa-Wolf parameters. This apply only to time-dependent parameters.
If the returned matrix is non-null, then the transformation is represented by an affine transform which can be applied on geocentric coordinates. This is identified in the EPSG database as operation method 1033 – Position Vector transformation (geocentric domain), or 1053 – Time-dependent Position Vector transformation.
targetDatum
- The target datum.areaOfInterest
- The geographic and temporal extent where the transformation should be valid, or null
.this
to target
in geocentric space, or null
if none.BursaWolfParameters.getPositionVectorTransformation(Date)
public boolean equals(Object object, ComparisonMode mode)
equals
in interface LenientComparable
equals
in class AbstractDatum
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 AbstractDatum
protected String formatTo(Formatter formatter)
Datum[…]
element.
Datum["World Geodetic System 1984", Ellipsoid["WGS84", 6378137.0, 298.257223563, LengthUnit["metre", 1]], Id["EPSG", 6326, Citation["OGP"], URI["urn:ogc:def:datum:EPSG::6326"]]]
Same datum using WKT 1.
DATUM["World Geodetic System 1984" SPHEROID["WGS84", 6378137.0, 298.257223563], AUTHORITY["EPSG", "6326"]]
formatTo
in class AbstractIdentifiedObject
formatter
- The formatter where to format the inner content of this WKT element."Datum"
.FormattableObject.toWKT()
,
FormattableObject.toString()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.