us.zuercher.gpx2map.coord
Class UTM

java.lang.Object
  extended by us.zuercher.gpx2map.coord.UTM

public final class UTM
extends Object

UTM represents a location on the UTM (Universal Transverse Mercator) grid.

See: The USGS UTM Grid factsheet

UTM is limited to the latitudes between 84 degrees N and 80 degrees S. See: http://earth-info.nga.mil/GandG/coordsys/grids/utm_basics_2005.doc and http://www.maptools.com/UsingUTM/UTMdetails.html.

Author:
Stephan Zuercher

Field Summary
private  double easting
          UTM Easting.
private  char letter
          UTM Letter Designator.
private  double northing
          UTM Northing.
private  int zone
          UTM Zone.
 
Constructor Summary
UTM(double northing, double easting, int zone, char letter)
          Construct a new UTM coordinate.
 
Method Summary
 boolean equals(Object other)
          Test whether this coordinate is equal to another.
 boolean equals(UTM other)
          Test whether this coordinate is equal to another.
 double getEasting()
          Return the meters of easting for this UTM coordinate.
 char getLetter()
          Return the UTM latitudinal letter designator for this UTM coordinate.
 double getNorthing()
          Return the meters of northing for this UTM coordinate.
 int getZone()
          Return the UTM longitudinal zone for this UTM coordinate.
 int hashCode()
          Compute a reasonable hash code for this coordinate.
 String toString()
          Generate a string describing this coordinate.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

northing

private final double northing
UTM Northing.


easting

private final double easting
UTM Easting.


zone

private final int zone
UTM Zone.


letter

private final char letter
UTM Letter Designator.

Constructor Detail

UTM

public UTM(double northing,
           double easting,
           int zone,
           char letter)
Construct a new UTM coordinate.

Parameters:
northing - meters of northing
easting - meters of easting
zone - UTM longitutdinal zone
letter - UTM latitudinal letter designator
Method Detail

getNorthing

public double getNorthing()
Return the meters of northing for this UTM coordinate.

Returns:
meters of northing for this UTM coordinate.

getEasting

public double getEasting()
Return the meters of easting for this UTM coordinate.

Returns:
meters of easting for this UTM coordinate.

getZone

public int getZone()
Return the UTM longitudinal zone for this UTM coordinate.

Returns:
UTM longitudinal zone for this UTM coordinate.

getLetter

public char getLetter()
Return the UTM latitudinal letter designator for this UTM coordinate.

Returns:
UTM latitudinal letter designator for this UTM coordinate.

toString

public String toString()
Generate a string describing this coordinate.

Overrides:
toString in class Object
Returns:
a string describing this coordinate.

hashCode

public int hashCode()
Compute a reasonable hash code for this coordinate.

Overrides:
hashCode in class Object
Returns:
a reasonable hash code for this coordinate.

equals

public boolean equals(UTM other)
Test whether this coordinate is equal to another.

Parameters:
other - coordinate to compare to
Returns:
true if they are equal, false otherwise

equals

public boolean equals(Object other)
Test whether this coordinate is equal to another.

Overrides:
equals in class Object
Parameters:
other - coordinate to compare to
Returns:
true if they are equal, false otherwise
Throws:
ClassCastException - if other is not a UTM