Class Position


  • public class Position
    extends java.lang.Object
    A Position represents the absolute location of a point in 3D space, independent of any particular Datum, Ellipsoid or type of coordinates. The nature of the internal representation of this point is deliberately encapsulated and irrelevant. This class does not override the toString() method because a Position needs to be part of a CoordinateSystem to have a meaningful String representation.

    Instances of this class are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      Position​(LatLong geo, double ellipsoidHeight, Ellipsoid sphere, Datum datum)
      Create a new Position using Lat/Long relative to a specified Ellipsoid and Datum
      Position​(XYZ point, Datum datum)
      Creates a new instance of Position based on cartesian coordinates relative to the specified Datum.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      XYZ coords​(Datum datum)
      Get the cartesian coordinates of this Position relative to a specified Datum
      double ellipsoidHeight​(Ellipsoid sphere, Datum datum)
      Calculate the height of this Position above the specified Ellipsoid.
      boolean equals​(java.lang.Object o)
      Compare this Position with another Object
      LatLong toLatLong​(Ellipsoid sphere, Datum datum)
      Get the LatLong of this Position relative to specified Ellipsoid and Datum
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Position

        public Position​(XYZ point,
                        Datum datum)
        Creates a new instance of Position based on cartesian coordinates relative to the specified Datum.
        Parameters:
        point - XYZ coordinates of this position relative to the specified Datum
        datum - The Datum used as the basis of the cartesian coordinates
      • Position

        public Position​(LatLong geo,
                        double ellipsoidHeight,
                        Ellipsoid sphere,
                        Datum datum)
        Create a new Position using Lat/Long relative to a specified Ellipsoid and Datum
        Parameters:
        geo - LatLong of the point
        ellipsoidHeight - Height above the Ellipsoid of this point (double)
        sphere - The Ellipsoid against which this Lat and Lon are defined
        datum - The Datum used to measure the Lat and Lon
    • Method Detail

      • coords

        public XYZ coords​(Datum datum)
        Get the cartesian coordinates of this Position relative to a specified Datum
        Parameters:
        datum - The Datum against which to measure the Position
        Returns:
        Cartesian (XYZ) coordinates of this Position
      • toLatLong

        public LatLong toLatLong​(Ellipsoid sphere,
                                 Datum datum)
        Get the LatLong of this Position relative to specified Ellipsoid and Datum
        Parameters:
        sphere - The Ellipsoid to use as reference
        datum - The Datum to measure relative to
        Returns:
        A LatLong object for this Position
      • ellipsoidHeight

        public double ellipsoidHeight​(Ellipsoid sphere,
                                      Datum datum)
        Calculate the height of this Position above the specified Ellipsoid.
        Parameters:
        sphere - The Ellipsoid from which to calculate the height
        datum - The Datum defining the location of the Ellipsoid
        Returns:
        The height in metres of this position above the Ellipsoid
      • equals

        public boolean equals​(java.lang.Object o)
        Compare this Position with another Object
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The Object to compare with
        Returns:
        TRUE if o is an instance of Position co-located with this Position.