Package org.geotools.referencing.datum
Class DefaultGeodeticDatum
Object
Formattable
AbstractIdentifiedObject
AbstractDatum
DefaultGeodeticDatum
- All Implemented Interfaces:
Serializable,Datum,GeodeticDatum,IdentifiedObject,PROJFormattable
Defines the location and precise orientation in 3-dimensional space of a defined ellipsoid (or sphere) that
approximates the shape of the earth. Used also for Cartesian coordinate system centered in this ellipsoid (or
sphere).
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe"bursaWolf"property for datum shifts.static final DefaultGeodeticDatumThe default WGS 1984 datum.Fields inherited from class AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATORFields inherited from class Formattable
SINGLE_LINEFields inherited from interface Datum
ANCHOR_POINT_KEY, DOMAIN_OF_VALIDITY_KEY, REALIZATION_EPOCH_KEY, SCOPE_KEYFields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultGeodeticDatum(String name, Ellipsoid ellipsoid, PrimeMeridian primeMeridian) Constructs a geodetic datum from a name.DefaultGeodeticDatum(Map<String, ?> properties, Ellipsoid ellipsoid, PrimeMeridian primeMeridian) Constructs a geodetic datum from a set of properties.Constructs a new datum with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(AbstractIdentifiedObject object, boolean compareMetadata) Compare this datum with the specified object for equality.formatPROJ(PROJFormatter formatter) Format the inner part of a PROJFormattable object.protected StringFormat the inner part of a Well Known Text (WKT) element.static MatrixgetAffineTransform(GeodeticDatum source, GeodeticDatum target) Returns a matrix that can be used to define a transformation to the specified datum.Returns all Bursa Wolf parameters specified in thepropertiesmap at construction time.getBursaWolfParameters(GeodeticDatum target) Returns Bursa Wolf parameters for a datum shift toward the specified target, ornullif none.Returns the ellipsoid.Returns the prime meridian.inthashCode()Returns a hash value for this geodetic datum.static booleanReturnstrueif the specified object is equals (at least on computation purpose) to theWGS84datum.Methods inherited from class AbstractDatum
getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScopeMethods inherited from class AbstractIdentifiedObject
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches, nameMatchesMethods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKTMethods inherited from interface Datum
getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScopeMethods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
WGS84
The default WGS 1984 datum. -
BURSA_WOLF_KEY
The"bursaWolf"property for datum shifts.- See Also:
-
-
Constructor Details
-
DefaultGeodeticDatum
Constructs a new datum with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.- Since:
- 2.2
-
DefaultGeodeticDatum
Constructs a geodetic datum from a name.- Parameters:
name- The datum name.ellipsoid- The ellipsoid.primeMeridian- The prime meridian.
-
DefaultGeodeticDatum
public DefaultGeodeticDatum(Map<String, ?> properties, Ellipsoid ellipsoid, PrimeMeridian primeMeridian) Constructs a geodetic datum from a set of properties. The properties map is given unchanged to the super-class constructor. Additionally, the following properties are understood by this construtor:Property name Value type Value given to "bursaWolf"BursaWolfParametersor an array of thosegetBursaWolfParameters()- Parameters:
properties- Set of properties. Should contains at least"name".ellipsoid- The ellipsoid.primeMeridian- The prime meridian.
-
-
Method Details
-
getEllipsoid
Returns the ellipsoid.- Specified by:
getEllipsoidin interfaceGeodeticDatum- Returns:
- The ellipsoid.
-
getPrimeMeridian
Returns the prime meridian.- Specified by:
getPrimeMeridianin interfaceGeodeticDatum- Returns:
- The prime meridian.
-
getBursaWolfParameters
Returns all Bursa Wolf parameters specified in thepropertiesmap at construction time.- Since:
- 2.4
-
getBursaWolfParameters
Returns Bursa Wolf parameters for a datum shift toward the specified target, ornullif none. This method search only for Bursa-Wolf parameters explicitly specified in thepropertiesmap at construction time. This method doesn't try to infer a set of parameters from indirect informations. For example it doesn't try to inverse the parameters specified in thetargetdatum if none were found in this datum. If such an elaborated search is wanted, usegetAffineTransform(org.geotools.api.referencing.datum.GeodeticDatum, org.geotools.api.referencing.datum.GeodeticDatum)instead. -
getAffineTransform
Returns a matrix that can be used to define a transformation to the specified datum. If no transformation path is found, then this method returnsnull.- Parameters:
source- The source datum.target- The target datum.- Returns:
- An affine transform from
sourcetotarget, ornullif none. - See Also:
-
isWGS84
Returnstrueif the specified object is equals (at least on computation purpose) to theWGS84datum. This method may conservatively returnsfalseif the specified datum is uncertain (for example because it come from an other implementation). -
equals
Compare this datum with the specified object for equality.- Overrides:
equalsin classAbstractDatum- Parameters:
object- The object to compare tothis.compareMetadata-truefor performing a strict comparaison, orfalsefor comparing only properties relevant to transformations.- Returns:
trueif both objects are equal.
-
hashCode
public int hashCode()Returns a hash value for this geodetic datum. Name, remarks and the like are not taken in account. In other words, two geodetic datums will return the same hash value if they are equal in the sense of.equals(AbstractIdentifiedObject, false)- Overrides:
hashCodein classAbstractIdentifiedObject- Returns:
- The hash code value. This value doesn't need to be the same in past or future versions of this class.
-
formatWKT
Format the inner part of a Well Known Text (WKT) element.- Overrides:
formatWKTin classAbstractDatum- Parameters:
formatter- The formatter to use.- Returns:
- The WKT element name, which is "DATUM"
- See Also:
-
formatPROJ
Description copied from interface:PROJFormattableFormat the inner part of a PROJFormattable object.This method is automatically invoked by
PROJFormatter.append(PROJFormattable).For example for a element (
DefaultOperationMethod) of type Projection, the formatter will invoke this method to prepend the "+proj=" String for completing the PROJ String before appending the Projection Name (e.g. lcc for a Lambert Conformal Conic)- Specified by:
formatPROJin interfacePROJFormattable- Parameters:
formatter- The PROJFormatter to use.- Returns:
- The proj String of the PROJ element type if any. (e.g. +ellps= for named ellipsoids, +datum= for named datums).
-