uk.me.jstott.jcoord
Class UTMRef

java.lang.Object
  extended by uk.me.jstott.jcoord.CoordinateSystem
      extended by uk.me.jstott.jcoord.UTMRef

public class UTMRef
extends CoordinateSystem

This class is part of the Jcoord package. Visit the Jcoord website for more information.

Class to represent a Universal Transverse Mercator (UTM) reference.

(c) 2006 Jonathan Stott

Created on 11-Feb-2006

Since:
1.0
Version:
1.0
Author:
Jonathan Stott

Constructor Summary
UTMRef(double easting, double northing, char latZone, int lngZone)
          Deprecated. Use UTMRef(int, char, double, double) instead.
UTMRef(int lngZone, char latZone, double easting, double northing)
          Create a new UTM reference object.
 
Method Summary
 double getEasting()
          Get the easting.
 char getLatZone()
          Get the latitude zone character.
 int getLngZone()
          Get the longitude zone number.
 double getNorthing()
          Get the northing.
static char getUTMLatitudeZoneLetter(double latitude)
          Work out the UTM latitude zone from the latitude.
 LatLng toLatLng()
          Convert this UTM reference to a latitude and longitude.
 java.lang.String toString()
          Convert this UTM reference to a String representation for printing out.
 
Methods inherited from class uk.me.jstott.jcoord.CoordinateSystem
getDatum, setDatum
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UTMRef

public UTMRef(double easting,
              double northing,
              char latZone,
              int lngZone)
       throws NotDefinedOnUTMGridException
Deprecated. Use UTMRef(int, char, double, double) instead.

Create a new UTM reference object. Checks are made to make sure that the given parameters are roughly valid, but the checks are not exhaustive with regards to the easting value. Catching a NotDefinedOnUTMGridException does not necessarily mean that the UTM reference is well-formed. This is because that valid values for the easting vary depending on the latitude.

Parameters:
easting - the easting in metres.
northing - the northing in metres.
latZone - the latitude zone character.
lngZone - the longitude zone number.
Throws:
NotDefinedOnUTMGridException - if any of the parameters are invalid. Be careful that a valid value for the easting does not necessarily mean that the UTM reference is well-formed. The current checks do not take into account the varying range of valid values for the easting for different latitudes.
Since:
1.0

UTMRef

public UTMRef(int lngZone,
              char latZone,
              double easting,
              double northing)
       throws NotDefinedOnUTMGridException
Create a new UTM reference object. Checks are made to make sure that the given parameters are roughly valid, but the checks are not exhaustive with regards to the easting value. Catching a NotDefinedOnUTMGridException does not necessarily mean that the UTM reference is well-formed. This is because that valid values for the easting vary depending on the latitude.

Parameters:
lngZone - the longitude zone number.
latZone - the latitude zone character.
easting - the easting in metres.
northing - the northing in metres.
Throws:
NotDefinedOnUTMGridException - if any of the parameters are invalid. Be careful that a valid value for the easting does not necessarily mean that the UTM reference is well-formed. The current checks do not take into account the varying range of valid values for the easting for different latitudes.
Since:
1.1
Method Detail

toLatLng

public LatLng toLatLng()
Convert this UTM reference to a latitude and longitude.

Specified by:
toLatLng in class CoordinateSystem
Returns:
the converted latitude and longitude
Since:
1.0

getUTMLatitudeZoneLetter

public static char getUTMLatitudeZoneLetter(double latitude)
Work out the UTM latitude zone from the latitude.

Parameters:
latitude - the latitude to find the UTM latitude zone for
Returns:
the UTM latitude zone for the given latitude
Since:
1.0

toString

public java.lang.String toString()
Convert this UTM reference to a String representation for printing out.

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

getEasting

public double getEasting()
Get the easting.

Returns:
the easting
Since:
1.0

getNorthing

public double getNorthing()
Get the northing.

Returns:
the northing
Since:
1.0

getLatZone

public char getLatZone()
Get the latitude zone character.

Returns:
the latitude zone character
Since:
1.0

getLngZone

public int getLngZone()
Get the longitude zone number.

Returns:
the longitude zone number
Since:
1.0