Interface GeoLocation

All Known Implementing Classes:
LunarTime, SolarTime

public interface GeoLocation
Describes a geographical position with latitude, longitude and optionally altitude.
Since:
3.38/4.33
Author:
Meno Hochschild
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Obtains the geographical altitude of this instance relative to sea level.
    double
    Obtains the geographical latitude of this instance.
    double
    Obtains the geographical longitude of this instance.
    of​(double latitude, double longitude)
    Creates an instance with given geographical coordinates on sea level.
    of​(double latitude, double longitude, int altitude)
    Creates an instance with given geographical coordinates.
  • Method Details

    • of

      static GeoLocation of(double latitude, double longitude)

      Creates an instance with given geographical coordinates on sea level.

      Parameters:
      latitude - geographical latitude in decimal degrees (-90.0 <= x <= +90.0)
      longitude - geographical longitude in decimal degrees (-180.0 <= x < 180.0)
      Returns:
      GeoLocation
      Throws:
      IllegalArgumentException - if the coordinates are out of range
    • of

      static GeoLocation of(double latitude, double longitude, int altitude)

      Creates an instance with given geographical coordinates.

      Parameters:
      latitude - geographical latitude in decimal degrees (-90.0 <= x <= +90.0)
      longitude - geographical longitude in decimal degrees (-180.0 <= x < 180.0)
      altitude - geographical altitude relative to sea level in meters (0 <= x < 11,0000)
      Returns:
      GeoLocation
      Throws:
      IllegalArgumentException - if the coordinates are out of range
    • getLatitude

      double getLatitude()

      Obtains the geographical latitude of this instance.

      Returns:
      latitude in decimal degrees (-90.0 <= x <= +90.0)
    • getLongitude

      double getLongitude()

      Obtains the geographical longitude of this instance.

      Returns:
      longitude in decimal degrees (-180.0 <= x < 180.0)
    • getAltitude

      int getAltitude()

      Obtains the geographical altitude of this instance relative to sea level.

      Returns:
      altitude in meters (0 <= x < 11,0000)