com.oziexplorer
Class UTMGridRef

java.lang.Object
  extended by com.oziexplorer.Position
      extended by com.oziexplorer.GridRef
          extended by com.oziexplorer.UTMGridRef

public class UTMGridRef
extends GridRef

This class extends GridRef and provides UTM Grid references.

Copyright 2011 Alan Burlison, . All rights reserved. Use is subject to license terms, see LICENSE.txt.
SourceForge.net


Field Summary
static String DATUM
          Datum used by UTM grid references.
protected  String hemisphere
          The UTM hemisphere (N or S).
 
Fields inherited from class com.oziexplorer.GridRef
defaultGrid, easting, grid, northing, zone
 
Fields inherited from class com.oziexplorer.Position
comparisonAccuracy, datum
 
Constructor Summary
UTMGridRef(Position pos)
          Create a new UTM reference from the specified Position.
UTMGridRef(String zone, double easting, double northing)
          Creates a new instance of UTMGridRef in the default (WGS84) datum using the zone and (easting, northing) values (in metres).
UTMGridRef(String datum, String zone, double easting, double northing)
          Creates a new instance of UTMGridRef given a datum, zone and (easting, northing) values (in metres).
UTMGridRef(String datum, String zone, String hemisphere, double easting, double northing)
          Creates a new instance of UTMGridRef given a datum, zone, hemisphere and (easting, northing) values (in metres).
 
Method Summary
 UTMGridRef addVector(SpatialVector vector)
          Return a new Position which is offset from the current position by the given vector, specified as a SpatialVector.
 boolean equals(Object that)
          Test if two UTM grid references are equal.
 String getHemisphere()
          Retrieve the UTM hemisphere, if specified.
 int hashCode()
          Return the hash code for this object.
 String toString()
          Retrieve the UTM grid reference.
 
Methods inherited from class com.oziexplorer.GridRef
getDefaultGrid, getEasting, getGrid, getNorthing, getZone, setDefaultGrid, vectorBetween
 
Methods inherited from class com.oziexplorer.Position
getComparisonAccuracy, getDatum, setComparisonAccuracy
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATUM

public static final String DATUM
Datum used by UTM grid references.

See Also:
Constant Field Values

hemisphere

protected final String hemisphere
The UTM hemisphere (N or S).

Constructor Detail

UTMGridRef

public UTMGridRef(String datum,
                  String zone,
                  String hemisphere,
                  double easting,
                  double northing)
Creates a new instance of UTMGridRef given a datum, zone, hemisphere and (easting, northing) values (in metres).

Parameters:
datum - datum of the UTM grid reference.
zone - name of the UTM zone.
hemisphere - UTM hemisphere - N or S.
easting - easting in metres.
northing - northing in metres.

UTMGridRef

public UTMGridRef(String datum,
                  String zone,
                  double easting,
                  double northing)
Creates a new instance of UTMGridRef given a datum, zone and (easting, northing) values (in metres). Use this form if the zone contains the UTM zone letter.

Parameters:
datum - datum of the UTM grid reference.
zone - name of the UTM zone.
easting - easting in metres.
northing - northing in metres.

UTMGridRef

public UTMGridRef(String zone,
                  double easting,
                  double northing)
Creates a new instance of UTMGridRef in the default (WGS84) datum using the zone and (easting, northing) values (in metres). Use this form if the zone contains the UTM zone letter.

Parameters:
zone - name of the UTM zone.
easting - easting in metres.
northing - northing in metres.

UTMGridRef

public UTMGridRef(Position pos)
           throws OziException
Create a new UTM reference from the specified Position.

Parameters:
pos - Position for the UTM reference.
Throws:
OziException - if OziAPI reports an error.
Method Detail

addVector

public UTMGridRef addVector(SpatialVector vector)
                     throws OziException
Return a new Position which is offset from the current position by the given vector, specified as a SpatialVector.

Overrides:
addVector in class GridRef
Parameters:
vector - the SpatialVector to offset by.
Returns:
the new Position.
Throws:
OziException - if OziAPI returns an error.

equals

public boolean equals(Object that)
Test if two UTM grid references are equal.

Overrides:
equals in class GridRef
Parameters:
that - the object to compare against.
Returns:
true if the objects are equal.

hashCode

public int hashCode()
Return the hash code for this object.

Overrides:
hashCode in class GridRef
Returns:
the hash code for this object.

getHemisphere

public String getHemisphere()
Retrieve the UTM hemisphere, if specified.

Returns:
the UTM hemisphere, if specified.

toString

public String toString()
Retrieve the UTM grid reference.

Overrides:
toString in class GridRef
Returns:
the UTM grid reference.