Class GeodesicPosition

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class GeodesicPosition
    extends Object
    implements Cloneable, Serializable
    Describes a GPS position in the geographic WSG84 standard.

    The geographic latitude (abbreviation: Lat., or phi) of a point on the Earth's surface is the angle between the equatorial plane and a line that passes through that point and is normal to the surface of a reference ellipsoid which approximates the shape of the Earth. This line passes a few kilometers away from the center of the Earth except at the poles and the equator where it passes through Earth's center. Lines joining points of the same latitude trace circles on the surface of the Earth called parallels, as they are parallel to the equator and to each other. The north pole is 90° N; the south pole is 90° S. The 0° parallel of latitude is designated the equator, the fundamental plane of all geographic coordinate systems. The equator divides the globe into Northern and Southern Hemispheres.

    The Longitude (abbreviation: Long., or lambda) of a point on the Earth's surface is the angle east or west from a reference meridian to another meridian that passes through that point. All meridians are halves of great ellipses (often improperly called great circles), which converge at the north and south poles.

    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:53
    Author:
    Stéphane GALLAND
    See Also:
    Serialized Form
    Maven Group Id:
    org.arakhne.afc.gis
    Maven Artifact Id:
    giscore
    • Field Detail

      • DEFAULT_SYMBOL_IN_STRING_REPRESENTATION

        public static final boolean DEFAULT_SYMBOL_IN_STRING_REPRESENTATION
        Default usage of the direction symbols in the string representation when not defined by the user.
        See Also:
        Constant Field Values
      • lambda

        public final double lambda
        Lambda component in the WSG84 standard.
      • phi

        public final double phi
        Phi component in the WSG84 standard.
    • Constructor Detail

      • GeodesicPosition

        public GeodesicPosition​(int latDegree,
                                int latMinute,
                                double latSecond,
                                SexagesimalLatitudeAxis latAxis,
                                int longDegree,
                                int longMinute,
                                double longSecond,
                                SexagesimalLongitudeAxis longAxis)
        Construct a GSC position from its sexagesimal representation.
        Parameters:
        latDegree - is the latitute degree in [0;180)
        latMinute - is the latitute minute in [0;60)
        latSecond - is the latitute second in [0;60)
        latAxis - is the axis of the given latitude coordinate.
        longDegree - is the longitude degree in [0;180)
        longMinute - is the longitude minute in [0;60)
        longSecond - is the longitude second in [0;60)
        longAxis - is the axis of the given longitude coordinate.
      • GeodesicPosition

        public GeodesicPosition​(double lambda,
                                double phi)
        Construct a GSC position.
        Parameters:
        lambda - is the longitude in degrees.
        phi - is the latitude in degrees.
      • GeodesicPosition

        public GeodesicPosition​(GeodesicPosition position)
        Construct a GSC position.
        Parameters:
        position - in degrees.
      • GeodesicPosition

        public GeodesicPosition​(Tuple2D<?> position)
        Construct a GSC position.
        Parameters:
        position - in degrees.
    • Method Detail

      • getLatitude

        @Pure
        public double getLatitude()
        Replies the latitude phi.
        Returns:
        phi in degrees.
      • getLatitudeDegree

        @Pure
        public int getLatitudeDegree()
        Replies the degree of the sexagesimal representation of the latitude phi.
        Returns:
        the latitude degree in [0;180).
      • getLatitudeMinute

        @Pure
        public int getLatitudeMinute()
        Replies the minute of the sexagesimal representation of the latitude phi.
        Returns:
        the latitude minute in [0;60).
      • getLatitudeSecond

        @Pure
        public double getLatitudeSecond()
        Replies the second of the sexagesimal representation of the latitude phi.
        Returns:
        the latitude second in [0;60).
      • getLatitudeAxis

        @Pure
        public SexagesimalLatitudeAxis getLatitudeAxis()
        Replies the axis of the sexagesimal representation of the latitude phi.
        Returns:
        the axis of the latitude.
      • getLongitude

        @Pure
        public double getLongitude()
        Replies the longitude lamda.
        Returns:
        lambda in degrees.
      • getLongitudeDegree

        @Pure
        public int getLongitudeDegree()
        Replies the degree of the sexagesimal representation of the longitude phi.
        Returns:
        the longitude degree in [0;180).
      • getLongitudeMinute

        @Pure
        public int getLongitudeMinute()
        Replies the minute of the sexagesimal representation of the longitude phi.
        Returns:
        the longitude minute in [0;60).
      • getLongitudeSecond

        @Pure
        public double getLongitudeSecond()
        Replies the second of the sexagesimal representation of the longitude phi.
        Returns:
        the longitude second in [0;60).
      • getLongitudeAxis

        @Pure
        public SexagesimalLongitudeAxis getLongitudeAxis()
        Replies the axis of the sexagesimal representation of the longitude phi.
        Returns:
        the axis of the latitude.
      • toPoint2d

        @Pure
        public Point2d toPoint2d()
        Replies the GPS position as a point, where x is lambda and y is phi.
        Returns:
        the point representation of this GPS position in degrees..
      • toDMSString

        @Pure
        public static String toDMSString​(double lambda,
                                         double phi,
                                         boolean useSymbolicDirection)
        Replies the string representation of the longitude/latitude coordinates in the DMS format: coordinate containing degrees (integer), minutes (integer), and seconds (integer, or real number).

        Example with symbolic direction: 40°26'47"N 79°58'36"W
        Example without symbolic direction: 40°26'47" -79°58'36"

        Parameters:
        lambda - is the longitude in degrees.
        phi - is the latitude in degrees.
        useSymbolicDirection - indicates if the directions should be output with there symbols or if there are represented by the signs of the coordinates.
        Returns:
        the string representation of the longitude/latitude coordinates.
      • toDecimalDegreeString

        @Pure
        public static String toDecimalDegreeString​(double lambda,
                                                   double phi,
                                                   boolean useSymbolicDirection)
        Replies the string representation of the longitude/latitude coordinates in the Decimal Degree format: coordinate containing only degrees (integer, or real number).

        Example: 40.446195N 79.948862W

        Parameters:
        lambda - is the longitude in degrees.
        phi - is the latitude in degrees.
        useSymbolicDirection - indicates if the directions should be output with there symbols or if there are represented by the signs of the coordinates.
        Returns:
        the string representation of the longitude/latitude coordinates.
      • toDecimalDegreeMinuteString

        @Pure
        public static String toDecimalDegreeMinuteString​(double lambda,
                                                         double phi,
                                                         boolean useSymbolicDirection)
        Replies the string representation of the longitude/latitude coordinates in the Decimal Degree Minute format: coordinate containing degrees (integer) and minutes (integer, or real number).

        Example: 40° 26.7717N 79° 56.93172W

        Parameters:
        lambda - is the longitude in degrees.
        phi - is the latitude in degrees.
        useSymbolicDirection - indicates if the directions should be output with there symbols or if there are represented by the signs of the coordinates.
        Returns:
        the string representation of the longitude/latitude coordinates.
      • setPreferredStringRepresentation

        public static void setPreferredStringRepresentation​(GeodesicPositionStringRepresentation representation,
                                                            boolean useSymbolicDirection)
        Set the preferred format of the string representation of a geodesic position.
        Parameters:
        representation - indicates the preferred string representation, or null to use the default.
        useSymbolicDirection - indicates if the directions should be output with there symbols or if there are represented by the signs of the coordinates.
        See Also:
        getPreferredStringRepresentation(), toString()
      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object