Package mccombe.mapping
Class UTM
- java.lang.Object
-
public class UTM extends TransverseMercator
The Universal Transverse Mercator coordinate system
-
-
Field Summary
-
Fields inherited from class mccombe.mapping.TransverseMercator
northernHemisphere, zone
-
Fields inherited from class 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 DatumUTM(ENPair en, int z, Ellipsoid sphere, Datum datum, boolean hemisphere)
Create a new UTM object from easting and northing values, zone number, Ellipsoid and DatumUTM(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Datum
defaultDatum()
Get the default datum for this type of CoordinateSystemEllipsoid
defaultEllipsoid()
Get the default Ellipsoid for this CoordinateSystemdouble
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 hemisphereint
getZone()
Get the zone number of this pointstatic 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(java.lang.String gridRef, Ellipsoid e, Datum d)
Static factory method to create a UTM instance from a grid reference Stringdouble
n0()
n0() defines the "false northing" distance of the projection.double
phi0()
phi0() defines the latitude of the true origin of the projection.java.lang.String
toString()
Provide a String representation of this UTM point in UTM coordinates-
Methods inherited from class mccombe.mapping.TransverseMercator
gridConvergence, pointScaleFactor, toEN
-
Methods inherited from class mccombe.mapping.CoordinateSystem
getDatum, getEllipsoid, getName, getPosition, getWGS84, parseDouble, toLatLong, toLatLongString
-
-
-
-
Constructor Detail
-
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
- Positione
- Ellipsoid to used
- 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
- Positionz
- The UTM zone numbere
- Ellipsoid to used
- 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 pointdatum
- Datu for this pointhemisphere
- - 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 pointdatum
- 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 Detail
-
makePoint
public static UTM makePoint(java.lang.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 instanced
- 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 classCoordinateSystem
- Returns:
- The default Datum (WGS84)
-
defaultEllipsoid
public Ellipsoid defaultEllipsoid()
Get the default Ellipsoid for this CoordinateSystem- Specified by:
defaultEllipsoid
in classCoordinateSystem
- Returns:
- Default Ellipsoid (GRS80)
-
toString
public java.lang.String toString()
Provide a String representation of this UTM point in UTM coordinates- Specified by:
toString
in classCoordinateSystem
- 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 classTransverseMercator
- 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 classTransverseMercator
- 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 classTransverseMercator
- 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 classTransverseMercator
- 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 classTransverseMercator
- Returns:
- The central meridian (radians)
-
-