Class DirectionAlongMeridian

  • All Implemented Interfaces:
    Serializable, Comparable<DirectionAlongMeridian>

    public final class DirectionAlongMeridian
    extends Object
    implements Comparable<DirectionAlongMeridian>, Serializable
    Parses axis direction of the kind "South along 90 deg East". Those directions are used in the EPSG database for polar stereographic projections.
    Since:
    2.7.2
    Author:
    Martin Desruisseaux
    See Also:
    Serialized Form
    • Method Detail

      • parse

        public static DirectionAlongMeridian parse​(String name)
        If the specified name is a direction along some specific meridian, returns information about that. Otherwise returns null.
      • getDirection

        public AxisDirection getDirection()
        Returns the axis direction for this object. If a suitable axis direction already exists, it will be returned. Otherwise a new one is created and returned.
      • getAngle

        public double getAngle​(DirectionAlongMeridian other)
        Returns the arithmetic (counterclockwise) angle from this direction to the specified direction, in decimal degrees. This method returns a value between -180° and +180°, or NaN if the base directions don't match. A positive angle denote a right-handed system.

        Example: the angle from "North along 90 deg East" to "North along 0 deg is 90°.

      • compareTo

        public int compareTo​(DirectionAlongMeridian that)
        Compares this direction with the specified one for order. This method tries to reproduce the ordering used for the majority of coordinate systems in the EPSG database, i.e. the ordering of a right-handed coordinate system. Examples of ordered pairs that we should get (extracted from the EPSG database):
        North along 90 deg East, North along 0 deg
        North along 75 deg West, North along 165 deg West
        South along 90 deg West, South along 0 deg
        South along 180 deg, South along 90 deg West
        North along 130 deg West North along 140 deg East
        Specified by:
        compareTo in interface Comparable<DirectionAlongMeridian>
      • equals

        public boolean equals​(Object object)
        Tests this object for equality with the specified one. This method is used mostly for assertions.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Returns a hash code value, for consistency with equals(java.lang.Object).
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Returns a string representation of this direction, using a syntax matching the one used by EPSG. This string representation will be used for creating a new AxisDirection. The generated name should be identical to EPSG name, but we use the generated one anyway (rather than the one provided by EPSG) in order to make sure that we create a single AxisDirection for a given direction; we avoid potential differences like lower versus upper cases, amount of white space, etc.
        Overrides:
        toString in class Object