Class DefaultPrimeMeridian

    • Field Detail

      • GREENWICH

        public static final DefaultPrimeMeridian GREENWICH
        The Greenwich meridian, with angular measurements in decimal degrees.
    • Constructor Detail

      • DefaultPrimeMeridian

        public DefaultPrimeMeridian​(PrimeMeridian meridian)
        Constructs a new prime meridian 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.
        Parameters:
        meridian - The prime meridian to copy.
        Since:
        2.2
      • DefaultPrimeMeridian

        public DefaultPrimeMeridian​(String name,
                                    double greenwichLongitude)
        Constructs a prime meridian from a name. The greenwichLongitude value is assumed in decimal degrees.
        Parameters:
        name - The datum name.
        greenwichLongitude - The longitude value relative to the Greenwich Meridian.
      • DefaultPrimeMeridian

        public DefaultPrimeMeridian​(String name,
                                    double greenwichLongitude,
                                    Unit<Angle> angularUnit)
        Constructs a prime meridian from a name.
        Parameters:
        name - The datum name.
        greenwichLongitude - The longitude value relative to the Greenwich Meridian.
        angularUnit - The angular unit of the longitude.
      • DefaultPrimeMeridian

        public DefaultPrimeMeridian​(Map<String,​?> properties,
                                    double greenwichLongitude,
                                    Unit<Angle> angularUnit)
        Constructs a prime meridian from a set of properties. The properties map is given unchanged to the super-class constructor.
        Parameters:
        properties - Set of properties. Should contains at least "name".
        greenwichLongitude - The longitude value relative to the Greenwich Meridian.
        angularUnit - The angular unit of the longitude.
    • Method Detail

      • getGreenwichLongitude

        public double getGreenwichLongitude()
        Longitude of the prime meridian measured from the Greenwich meridian, positive eastward. The greenwichLongitude initial value is zero, and that value shall be used when the meridian name value is "Greenwich".
        Specified by:
        getGreenwichLongitude in interface PrimeMeridian
        Returns:
        The prime meridian Greenwich longitude, in angular unit.
      • getGreenwichLongitude

        public double getGreenwichLongitude​(Unit<Angle> targetUnit)
        Returns the longitude value relative to the Greenwich Meridian, expressed in the specified units. This convenience method makes it easier to obtain longitude in decimal degrees ( getGreenwichLongitude(NonSI.DEGREE_ANGLE)), regardless of the underlying angular units of this prime meridian.
        Parameters:
        targetUnit - The unit in which to express longitude.
        Returns:
        The Greenwich longitude in the given units.
      • equals

        public boolean equals​(AbstractIdentifiedObject object,
                              boolean compareMetadata)
        Compare this prime meridian with the specified object for equality.
        Overrides:
        equals in class AbstractIdentifiedObject
        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 prime meridian. Name, remarks and the like are not taken in account. In other words, two prime meridians 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.