com.oziexplorer
Class UTMGridRef
java.lang.Object
com.oziexplorer.Position
com.oziexplorer.GridRef
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.
|
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). |
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).
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.
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.