Package uk.co.mccombe.mapping

# Class UTM

java.lang.Object
uk.co.mccombe.mapping.CoordinateSystem
uk.co.mccombe.mapping.Projection
uk.co.mccombe.mapping.TransverseMercator
uk.co.mccombe.mapping.UTM

public class UTM extends TransverseMercator
The Universal Transverse Mercator coordinate system

## Field Summary

### Fields inherited from class uk.co.mccombe.mapping.TransverseMercator

`northernHemisphere, zone`

### Fields inherited from class uk.co.mccombe.mapping.CoordinateSystem

`locus, ref, sph`

## Constructor Summary

Constructors
Constructor
Description
`UTM(ENPair en)`
Deprecated.
`UTM(ENPair en, int z, Ellipsoid sphere, Datum datum)`
Create a new UTM object from easting and northing values, zone number, Ellipsoid and Datum
`UTM(ENPair en, int z, Ellipsoid sphere, Datum datum, boolean hemisphere)`
Create a new UTM object from easting and northing values, zone number, Ellipsoid and Datum
`UTM(Position p, int z, Ellipsoid e, Datum d)`
Create a new instance of UTM from Position, UTM zone, Ellipsoid and Datum.
`UTM(Position p, Ellipsoid e, Datum d)`
Create a new instance from Position, Ellipsoid and Datum.

## Method Summary

Modifier and Type
Method
Description
`Datum`
`defaultDatum()`
Get the default datum for this type of CoordinateSystem
`Ellipsoid`
`defaultEllipsoid()`
Get the default Ellipsoid for this CoordinateSystem
`double`
`e0()`
e0() defines the "false easting" distance of the projection.
`double`
`f0()`
The scale factor on the Central Meridian.
`boolean`
`getNorthernHemisphere()`
Check if this point is in the northern hemisphere
`int`
`getZone()`
Get the zone number of this point
`static int`
`getZone(double lon)`
A static method to calculate the correct zone number for a specified longitude.
`double`
`lamda0()`
lamda0() defines the longitude (in radians) of the true origin also known as the "Central Meridian".
`static UTM`
`makePoint(String gridRef, Ellipsoid e, Datum d)`
Static factory method to create a UTM instance from a grid reference String
`double`
`n0()`
n0() defines the "false northing" distance of the projection.
`double`
`phi0()`
phi0() defines the latitude of the true origin of the projection.
`String`
`toString()`
Provide a String representation of this UTM point in UTM coordinates

### Methods inherited from class uk.co.mccombe.mapping.TransverseMercator

`gridConvergence, pointScaleFactor, toEN`

### Methods inherited from class uk.co.mccombe.mapping.CoordinateSystem

`getDatum, getEllipsoid, getName, getPosition, getWGS84, parseDouble, toLatLong, toLatLongString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### UTM

public UTM(Position p, Ellipsoid e, Datum d)
Create a new instance from Position, Ellipsoid and Datum. The UTM zone is calculated automatically from the Position's longitude (relative to the specified Ellipsoid and Datum).

Parameters:
  `p` - Position
  `e` - Ellipsoid to use
  `d` - Datum to use

### UTM

public UTM(Position p, int z, Ellipsoid e, Datum d)
Create a new instance of UTM from Position, UTM zone, Ellipsoid and Datum.

Parameters:
  `p` - Position
  `z` - The UTM zone number
  `e` - Ellipsoid to use
  `d` - The Datum for this point

### UTM

public UTM(ENPair en, int z, Ellipsoid sphere, Datum datum, boolean hemisphere)
Create a new UTM object from easting and northing values, zone number, Ellipsoid and Datum

Parameters:
  `en` - Easting and northing values (m)
  `z` - Zone number (0-59)
  `sphere` - Ellipsoid for this point
  `datum` - Datu for this point
  `hemisphere` - - true if point is in the NOrthern Hemisphere

### UTM

public UTM(ENPair en, int z, Ellipsoid sphere, Datum datum)
Create a new UTM object from easting and northing values, zone number, Ellipsoid and Datum

Parameters:
  `en` - Easting and northing values (m)
  `z` - Zone number (0-59)
  `sphere` - Ellipsoid for this point
  `datum` - Datu for this point

### UTM

@Deprecated public UTM(ENPair en)
Deprecated.
This constructor is provided for test purposes only (because it has a common interface with other sub-classes of Projection). Its use is @deprecated Use the UTM(ENPair, int, Ellipsoid, Datum) instead.

Parameters:
  `en` - Easting and northing values (m). Zone number is assumed to be 0.

## Method Details

### makePoint

public static UTM makePoint(String gridRef, Ellipsoid e, Datum d) throws GridFormatException
Static factory method to create a UTM instance from a grid reference String

Parameters:
  `gridRef` - Grid reference String e.g. "32T 31577 202576"
  `e` - Ellipsoid for this instance
  `d` - Datum for this instance
Returns:
  A new instance of UTM for the specified point.
Throws:
  `GridFormatException` - if the grid rference String is invalid

### defaultDatum

public Datum defaultDatum()
Get the default datum for this type of CoordinateSystem

Specified by:
  `defaultDatum` in class `CoordinateSystem`
Returns:
  The default Datum (WGS84)

### defaultEllipsoid

public Ellipsoid defaultEllipsoid()
Get the default Ellipsoid for this CoordinateSystem

Specified by:
  `defaultEllipsoid` in class `CoordinateSystem`
Returns:
  Default Ellipsoid (GRS80)

### toString

public String toString()
Provide a String representation of this UTM point in UTM coordinates

Specified by:
  `toString` in class `CoordinateSystem`
Returns:
  A UTM coordinate String

### getZone

public static int getZone(double lon)
A static method to calculate the correct zone number for a specified longitude.

Parameters:
  `lon` - Longitude (degrees)
Returns:
  Zone number (0-59)

### getZone

public int getZone()
Get the zone number of this point

Returns:
  Zone number (0-59)

### getNorthernHemisphere

public boolean getNorthernHemisphere()
Check if this point is in the northern hemisphere

Returns:
  true if this point is north of the equator

### f0

public double f0()
The scale factor on the Central Meridian. Generally, Transverse Mercator projections increasingly exagerate distances further from the central meridian. It is usual to reduce the scale factor at the central meridian to compensate for this effect and optimise the scale over the area of interest.

Specified by:
  `f0` in class `TransverseMercator`
Returns:
  the value of the ScaleFactor at the central meridian.

### e0

public double e0()
e0() defines the "false easting" distance of the projection. False origins are usually used with TM projections to ensure that easting and northing distances are always positive over the area of interest. e0() is used as an offset to the grid so that the "true origin" appears to have an easting value equal to e0().

Specified by:
  `e0` in class `TransverseMercator`
Returns:
  The false easting distance (double)

### n0

public double n0()
n0() defines the "false northing" distance of the projection. False origins are usually used with TM projections to ensure that easting and northing distances are always positive over the area of interest. n0() is used as an offset to the grid so that the "true origin" appears to have a northing value equal to n0().

Specified by:
  `n0` in class `TransverseMercator`
Returns:
  The false northing distance (double)

### phi0

public double phi0()
phi0() defines the latitude of the true origin of the projection. Note, however, that many Transverse Mercator projections employ a false origin. See n0() and e0() .

Specified by:
  `phi0` in class `TransverseMercator`
Returns:
  The latitude of the true origin (radians)

### lamda0

public double lamda0()
lamda0() defines the longitude (in radians) of the true origin also known as the "Central Meridian".

Specified by:
  `lamda0` in class `TransverseMercator`
Returns:
  The central meridian (radians)