Position
Date: 2016-06-25

org.osgi.util.position

## Class Position

- java.lang.Object
- - org.osgi.util.position.Position

-     public class Position
      extends java.lang.Object

  Position represents a geographic location, based on the WGS84 System (World Geodetic System 1984).

  The `org.osgi.util.measurement.Measurement` class is used to represent the values that make up a position.

  A given position object may lack any of it's components, i.e. the altitude may not be known. Such missing values will be represented by null.

  Position does not override the implementation of either equals() or hashCode() because it is not clear how missing values should be handled. It is up to the user of a position to determine how best to compare two position objects. A `Position` object is immutable.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Position(Measurement lat, Measurement lon, Measurement alt, Measurement speed, Measurement track)` Constructs a `Position` object with the given values.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Measurement` | `getAltitude()` Returns the altitude of this position in meters.
    `Measurement` | `getLatitude()` Returns the latitude of this position in radians.
    `Measurement` | `getLongitude()` Returns the longitude of this position in radians.
    `Measurement` | `getSpeed()` Returns the ground speed of this position in meters per second.
    `Measurement` | `getTrack()` Returns the track of this position in radians as a compass heading.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Position

          public Position(Measurement lat,
                  Measurement lon,
                  Measurement alt,
                  Measurement speed,
                  Measurement track)

      Constructs a `Position` object with the given values.
      Parameters:
        `lat` - a `Measurement` object specifying the latitude in radians, or null
        `lon` - a `Measurement` object specifying the longitude in radians, or null
        `alt` - a `Measurement` object specifying the altitude in meters, or null
        `speed` - a `Measurement` object specifying the speed in meters per second, or null
        `track` - a `Measurement` object specifying the track in radians, or null

  - ### Method Detail

    - #### getAltitude

          public Measurement getAltitude()

      Returns the altitude of this position in meters.
      Returns:
        a `Measurement` object in `Unit.m` representing the altitude in meters above the ellipsoid `null` if the altitude is not known.

    - #### getLongitude

          public Measurement getLongitude()

      Returns the longitude of this position in radians.
      Returns:
        a `Measurement` object in `Unit.rad` representing the longitude, or `null` if the longitude is not known.

    - #### getLatitude

          public Measurement getLatitude()

      Returns the latitude of this position in radians.
      Returns:
        a `Measurement` object in `Unit.rad` representing the latitude, or `null` if the latitude is not known..

    - #### getSpeed

          public Measurement getSpeed()

      Returns the ground speed of this position in meters per second.
      Returns:
        a `Measurement` object in `Unit.m_s` representing the speed, or `null` if the speed is not known..

    - #### getTrack

          public Measurement getTrack()

      Returns the track of this position in radians as a compass heading. The track is the extrapolation of previous previously measured positions to a future position.
      Returns:
        a `Measurement` object in `Unit.rad` representing the track, or `null` if the track is not known..