Class DistanceUtils

  • @Deprecated
    public final class DistanceUtils
    extends Object
    Replaced by Geodetic­Calculator. See SIS-385.
    Class to calculate distances on earth surface. Actual calculation code very similar to Apache SIS but refractor to allow use of custom classes.
    • Field Detail


        public static final double HALF_EARTH_CIRCUMFERENCE
        See Also:
        Constant Field Values
    • Method Detail

      • getPointOnGreatCircle

        public static DirectPosition2D getPointOnGreatCircle​(double latitude,
                                                             double longitude,
                                                             double d,
                                                             double bearing)
        Returns a coordinate on the great circle at the specified bearing.
        latitude - the latitude of center of circle
        longitude - the longitude of center of circle
        d - the distance from the center
        bearing - the great circle bearing
        a coordinate at the specified bearing
      • getHaversineDistance

        public static double getHaversineDistance​(double latitude1,
                                                  double longitude1,
                                                  double latitude2,
                                                  double longitude2)
        Calculates haversine (great circle) distance between two lat/lon coordinates.
        latitude1 - latitude of first coordinate
        longitude1 - longitude of first coordinate
        latitude2 - latitude of second coordinate
        longitude2 - longitude of second coordinate
        great circle distance between specified lat/lon coordinates