org.gvsig.fmap.mapcontrol.tools.geo
Class Geo

java.lang.Object
  extended by org.gvsig.fmap.mapcontrol.tools.geo.Geo

public class Geo
extends java.lang.Object

Mathematical utilities to work with geographical data:

Author:
Vicente Caballero Navarro

Field Summary
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 Summary
Geo()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Degree

public static double Degree
Degrees per radian.


HalfPi

public static double HalfPi
PI / 2, having PI = 3.14159265358979323846


SqKm

public static double SqKm
Square kilometres per spherical degree.


SqM

public static double SqM
Square metres per spherical degree.


SqMi

public static double SqMi
Square miles per spherical degree.

Constructor Detail

Geo

public Geo()
Method Detail

getDecimalDegrees

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

Parameters:
m - distance value in meters
Returns:
m * Radius at the equator

sphericalPolyArea

public 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.

Parameters:
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
Returns:
the area of a spherical polygon in spherical degrees


Copyright © 2014 gvSIG Association. All Rights Reserved.