uk.me.jstott.coordconv
Class GridReferenceConverter

java.lang.Object
  extended byuk.me.jstott.coordconv.GridReferenceConverter

public class GridReferenceConverter
extends java.lang.Object

Convert latitude/longitude to OSGB grid references and vice versa. Convert latitude/longitude to UTM references and vice/versa. Based on algorithm published by the Ordnance Survey at http://www.gps.gov.uk/guidecontents.asp

Version:
0.2
Author:
Jonathan Stott

Constructor Summary
GridReferenceConverter()
           
 
Method Summary
static OSGBGridReference latitudeLongitudeToOSGBGridReference(LatitudeLongitude latitudeLongitude)
          Convert a latitude and longitude into an OSGB grid reference
static UTMReference latitudeLongitudeToUTMReference(ReferenceEllipsoid ellipsoid, LatitudeLongitude latitudeLongitude)
          Convert a latitude and longitude to an UTM reference
static LatitudeLongitude OSGBGridReferenceToLatitudeLongitude(OSGBGridReference osgb)
          Convert an OSGB grid reference to latitude and longitude
 UTMReference OSGBGridReferenceToUTMReference(ReferenceEllipsoid ellipsoid, OSGBGridReference osgb)
          Convert an UTM reference to an OSGB grid reference
static LatitudeLongitude UTMReferenceToLatitudeLongitude(ReferenceEllipsoid ellipsoid, UTMReference utm)
          Convert an UTM reference to a latitude and longitude
 OSGBGridReference UTMReferenceToOSGBGridReference(ReferenceEllipsoid ellipsoid, UTMReference utm)
          Convert an OSGB grid reference to an UTM reference
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridReferenceConverter

public GridReferenceConverter()
Method Detail

OSGBGridReferenceToLatitudeLongitude

public static LatitudeLongitude OSGBGridReferenceToLatitudeLongitude(OSGBGridReference osgb)
Convert an OSGB grid reference to latitude and longitude

Parameters:
osgb - the OSGB grid reference to convert
Returns:
the latitude and longitude
Since:
0.1

latitudeLongitudeToOSGBGridReference

public static OSGBGridReference latitudeLongitudeToOSGBGridReference(LatitudeLongitude latitudeLongitude)
Convert a latitude and longitude into an OSGB grid reference

Parameters:
latitudeLongitude - the latitude and longitude to convert
Returns:
the OSGB grid reference
Since:
0.1

UTMReferenceToLatitudeLongitude

public static LatitudeLongitude UTMReferenceToLatitudeLongitude(ReferenceEllipsoid ellipsoid,
                                                                UTMReference utm)
Convert an UTM reference to a latitude and longitude

Parameters:
ellipsoid - A reference ellipsoid to use
utm - the UTM reference to convert
Returns:
the converted latitude and longitude
Since:
0.2

latitudeLongitudeToUTMReference

public static UTMReference latitudeLongitudeToUTMReference(ReferenceEllipsoid ellipsoid,
                                                           LatitudeLongitude latitudeLongitude)
Convert a latitude and longitude to an UTM reference

Parameters:
ellipsoid - A reference ellipsoid to use
latitudeLongitude - The latitude and longitude to convert
Returns:
the converted UTM reference
Since:
0.2

OSGBGridReferenceToUTMReference

public UTMReference OSGBGridReferenceToUTMReference(ReferenceEllipsoid ellipsoid,
                                                    OSGBGridReference osgb)
Convert an UTM reference to an OSGB grid reference

Parameters:
ellipsoid -
osgb -
Returns:
Since:
0.2

UTMReferenceToOSGBGridReference

public OSGBGridReference UTMReferenceToOSGBGridReference(ReferenceEllipsoid ellipsoid,
                                                         UTMReference utm)
Convert an OSGB grid reference to an UTM reference

Parameters:
ellipsoid -
utm -
Returns:
Since:
0.2