public class Geo extends Object
Mathematical utilities to work with geographical data:
Modifier and Type | Field and Description |
---|---|
static double |
Degree
Degrees per radian.
|
static double |
HalfPi
PI / 2, having PI = 3.14159265358979323846
|
static double |
SqKm
Square kilometres per spherical degree.
|
static double |
SqM
Square metres per spherical degree.
|
static double |
SqMi
Square miles per spherical degree.
|
Constructor and Description |
---|
Geo() |
Modifier and Type | Method and Description |
---|---|
static double |
getDecimalDegrees(double m)
Gets the decimal degrees equivalent to the m meters.
|
static double |
sphericalPolyArea(double[] lat,
double[] lon,
int n)
Returns the area of a spherical polygon in spherical degrees,
given the latitudes and longitudes in lat and lon, respectively.
|
public static double HalfPi
public static double Degree
public static double SqMi
public static double SqKm
public static double SqM
public static double getDecimalDegrees(double m)
Gets the decimal degrees equivalent to the m meters.
Uses this formula: m * R * PI, having R = Radius of the Earth at the equator
m
- distance value in meterspublic static double sphericalPolyArea(double[] lat, double[] lon, int n)
Returns the area of a spherical polygon in spherical degrees, given the latitudes and longitudes in lat and lon, respectively.
The n data points have indexes which range from 0 to N-1.
Uses the Haversine function for calculating the spherical area of the polygon.
lat
- latitude of the vertexes (must be in radians)lon
- longitude of the vertexes (must be in radians)n
- number of vertexes in the polygon