uk.me.jstott.jcoord
Class LatLng

java.lang.Object
  extended by uk.me.jstott.jcoord.LatLng

public class LatLng
extends java.lang.Object

Class to represent a latitude/longitude pair. (c) 2006 Jonathan Stott Created on 11-02-2006

Since:
1.0
Version:
1.0
Author:
Jonathan Stott

Constructor Summary
LatLng(double lat, double lng)
          Create a new LatLng object to represent a latitude/longitude pair.
 
Method Summary
 double distance(LatLng ll)
          Calculate the surface distance in kilometres from the this LatLng to the given LatLng.
 double getLat()
          Return the latitude in degrees.
 double getLng()
          Return the longitude in degrees.
 void toOSGB36()
          Convert this LatLng from the WGS84 datum to the OSGB36 datum using an approximate Helmert transformation.
 OSRef toOSRef()
          Convert this latitude and longitude into an OSGB (Ordnance Survey of Great Britain) grid reference.
 java.lang.String toString()
          Get a String representation of this LatLng object.
 UTMRef toUTMRef()
          Convert this latitude and longitude to a UTM reference.
 void toWGS84()
          Convert this LatLng from the OSGB36 datum to the WGS84 datum using an approximate Helmert transformation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatLng

public LatLng(double lat,
              double lng)
Create a new LatLng object to represent a latitude/longitude pair.

Parameters:
lat - the latitude in degrees
lng - the longitude in degrees
Since:
1.0
Method Detail

toString

public java.lang.String toString()
Get a String representation of this LatLng object.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this LatLng object.
Since:
1.0

toOSRef

public OSRef toOSRef()
Convert this latitude and longitude into an OSGB (Ordnance Survey of Great Britain) grid reference.

Returns:
the converted OSGB grid reference
Since:
1.0

toUTMRef

public UTMRef toUTMRef()
Convert this latitude and longitude to a UTM reference.

Returns:
the converted UTM reference
Since:
1.0

toWGS84

public void toWGS84()
Convert this LatLng from the OSGB36 datum to the WGS84 datum using an approximate Helmert transformation.

Since:
1.0

toOSGB36

public void toOSGB36()
Convert this LatLng from the WGS84 datum to the OSGB36 datum using an approximate Helmert transformation.

Since:
1.0

distance

public double distance(LatLng ll)
Calculate the surface distance in kilometres from the this LatLng to the given LatLng.

Parameters:
ll -
Returns:
the surface distance in km
Since:
1.0

getLat

public double getLat()
Return the latitude in degrees.

Returns:
the latitude in degrees
Since:
1.0

getLng

public double getLng()
Return the longitude in degrees.

Returns:
the longitude in degrees
Since:
1.0