Class DefaultGeodeticDatum

  • All Implemented Interfaces:
    Serializable, Datum, GeodeticDatum, IdentifiedObject

    public class DefaultGeodeticDatum
    extends AbstractDatum
    implements GeodeticDatum
    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:
    Ellipsoid, PrimeMeridian, Serialized Form
    • Constructor Detail

      • DefaultGeodeticDatum

        public DefaultGeodeticDatum​(GeodeticDatum datum)
        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

        public DefaultGeodeticDatum​(String name,
                                    Ellipsoid ellipsoid,
                                    PrimeMeridian primeMeridian)
        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"   BursaWolfParameters or an array of those   getBursaWolfParameters()
        Parameters:
        properties - Set of properties. Should contains at least "name".
        ellipsoid - The ellipsoid.
        primeMeridian - The prime meridian.
    • Method Detail

      • getBursaWolfParameters

        public BursaWolfParameters[] getBursaWolfParameters()
        Returns all Bursa Wolf parameters specified in the properties map at construction time.
        Since:
        2.4
      • getAffineTransform

        public static Matrix getAffineTransform​(GeodeticDatum source,
                                                GeodeticDatum target)
        Returns a matrix that can be used to define a transformation to the specified datum. If no transformation path is found, then this method returns null.
        Parameters:
        source - The source datum.
        target - The target datum.
        Returns:
        An affine transform from source to target, or null if none.
        See Also:
        BursaWolfParameters.getAffineTransform()
      • isWGS84

        public static boolean isWGS84​(Datum datum)
        Returns true if the specified object is equals (at least on computation purpose) to the WGS84 datum. This method may conservatively returns false if the specified datum is uncertain (for example because it come from an other implementation).
      • equals

        public boolean equals​(AbstractIdentifiedObject object,
                              boolean compareMetadata)
        Compare this datum with the specified object for equality.
        Overrides:
        equals in class AbstractDatum
        Parameters:
        object - The object to compare to this.
        compareMetadata - true for performing a strict comparaison, or false for comparing only properties relevant to transformations.
        Returns:
        true if 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:
        hashCode in class AbstractIdentifiedObject
        Returns:
        The hash code value. This value doesn't need to be the same in past or future versions of this class.