Package org.n52.io.crs
Class WGS84Util
java.lang.Object
org.n52.io.crs.WGS84Util
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
FieldsModifier and TypeFieldDescriptionprotected static final doubleThe mean radius of WGS84 ellipse.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetLatitudeDelta(double distance) Calculates the latitude delta from a point from a given distance.(package private) static doublegetLatitutesCircleRadius(double latitude) static doublegetLongitudeDelta(double latitude, double distance) Calculates the longitude delta for a given distance.static doublenormalizeLatitude(double latitude) Normalizes given latitude to bounds [-90.0,90.0].static doublenormalizeLongitude(double longitude) Normalizes given longitude to bounds [-180.0,180.0].static doubleshortestDistanceBetween(org.locationtech.jts.geom.Point a, org.locationtech.jts.geom.Point b) Calculates the shortest distance between two points on a great circle.
-
Field Details
-
EPSG_4326
- See Also:
-
EARTH_MEAN_RADIUS
protected static final double EARTH_MEAN_RADIUSThe mean radius of WGS84 ellipse.- See Also:
-
-
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.
-