Class WGS84Util

java.lang.Object
org.n52.io.crs.WGS84Util

public class WGS84Util extends Object
Some utility methods for WGS84 points. Note that all calculations are being made by assuming a spherical shape of the earth (not elliptic). The EARTH_MEAN_RADIUS is used as radius.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final double
    The mean radius of WGS84 ellipse.
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    getLatitudeDelta(double distance)
    Calculates the latitude delta from a point from a given distance.
    (package private) static double
    getLatitutesCircleRadius(double latitude)
     
    static double
    getLongitudeDelta(double latitude, double distance)
    Calculates the longitude delta for a given distance.
    static double
    normalizeLatitude(double latitude)
    Normalizes given latitude to bounds [-90.0,90.0].
    static double
    normalizeLongitude(double longitude)
    Normalizes given longitude to bounds [-180.0,180.0].
    static double
    shortestDistanceBetween(org.locationtech.jts.geom.Point a, org.locationtech.jts.geom.Point b)
    Calculates the shortest distance between two points on a great circle.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • WGS84Util

      public WGS84Util()
  • Method Details

    • shortestDistanceBetween

      public static double shortestDistanceBetween(org.locationtech.jts.geom.Point a, org.locationtech.jts.geom.Point b)
      Calculates the shortest distance between two points on a great circle.
      Parameters:
      a - a point.
      b - another point.
      Returns:
      the shortest distance between point A and point B.
    • getLongitudeDelta

      public static double getLongitudeDelta(double latitude, double distance)
      Calculates the longitude delta for a given distance.
      Parameters:
      latitude - the latitude in radians to calculate the distance delta from.
      distance - the distance in kilometer.
      Returns:
      the longitude delta in degrees.
    • getLatitudeDelta

      public static double getLatitudeDelta(double distance)
      Calculates the latitude delta from a point from a given distance.
      Parameters:
      distance - the distance in kilometer.
      Returns:
      the latitude delta in degrees.
    • getLatitutesCircleRadius

      static double getLatitutesCircleRadius(double latitude)
      Parameters:
      latitude - in degrees in radians.
      Returns:
      the length of the latitude radius.
    • normalizeLongitude

      public static double normalizeLongitude(double longitude)
      Normalizes given longitude to bounds [-180.0,180.0].
      Parameters:
      longitude - in degrees.
      Returns:
      the normalized longitude.
    • normalizeLatitude

      public static double normalizeLatitude(double latitude)
      Normalizes given latitude to bounds [-90.0,90.0].
      Parameters:
      latitude - in degrees.
      Returns:
      the normalized latitude.