Package com.iizix.geo

Interface ILongitudeLatitudeAltitude

  • All Superinterfaces:
    All Known Implementing Classes:

    public interface ILongitudeLatitudeAltitude
    extends ILongitudeLatitude
    Interface used for geolocation with longitude, latitude and altitude.

    Programming note: DO NOT COMPARE WITH Double.NaN as e.g. value==Double.NaN, use Double.isNaN(double) instead as comparison is always false.

    Christopher Mindus
    • Method Detail

      • getDistance

        static double getDistance​(double longitude1,
                                  double longitude2,
                                  double latitude1,
                                  double latitude2,
                                  double altitude1,
                                  double altitude2)
        Calculate distance between two points in latitude and longitude taking into account height difference. Uses Haversine method as its base.
        longitude1 - Longitude 1.
        longitude2 - Longitude 2.
        latitude1 - Latitude 1.
        latitude2 - Latitude 2.
        altitude1 - Altitude 1 in meters.
        altitude2 - Altitude 2 in meters.
        Distance in Meters, or Double.NaN if either values are Double.isNaN().
      • getAltitude

        double getAltitude()
        Gets the altitude in meters.
        The altitude, or NaN if not available.
      • getDistance

        default double getDistance​(ILongitudeLatitudeAltitude location,
                                   boolean useAltitude)
        Gets the distance in meters between this location and another.

        If the altitude is not available in either of the locations, the distance is calculated without altitude.

        location - The other location.
        useAltitude - Flag to calculate with altitude, if available.
        Distance in meters, Double.NaN if longitude/latitude values are not present.