Package pygeodesy :: Module utm :: Class Utm
[frames] | no frames]

Class Utm

object --+    
         |    
bases.Base --+
             |
            Utm

Universal Transverse Mercator (UTM) coordinate.

Instance Methods
 
__init__(self, zone, hemisphere, easting, northing, band='', datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran..., convergence=None, scale=None)
New UTM coordinate.
 
parseUTM(self, strUTM)
Parses a string to a UTM coordinate.
 
toLatLon(self, LatLon)
Converts this UTM coordinate to an (ellipsoidal) geodetic point.
 
toMgrs(self)
Converts this UTM coordinate to an MGRS grid reference.
 
toStr(self, prec=0, sep=' ', B=False, cs=False)
Returns a string representation of this UTM coordinate.
 
toStr2(self, prec=0, fmt='[%s]', sep=', ', B=False, cs=False)
Returns a string representation of this UTM coordinate.

Inherited from bases.Base: __repr__, __str__, classname, others, topsub

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties
  band
Gets the latitudinal band (C..X or '').
  convergence
Gets the meridian convergence (degrees or None).
  datum
Gets the datum (Datum).
  easting
Gets the easting (meter).
  hemisphere
Gets the hemisphere (N|S).
  northing
Gets the northing (meter).
  scale
Gets the grid scale (scalar or None).
  zone
Gets the longitudinal zone (1..60).

Inherited from object: __class__

Method Details

__init__(self, zone, hemisphere, easting, northing, band='', datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran..., convergence=None, scale=None)
(Constructor)

 

New UTM coordinate.

Parameters:
  • zone - UTM 6° longitudinal zone (int 1..60 covering 180°W. 180°E) or '00B' zone and band letter (string).
  • hemisphere - N for the northern or S for the southern hemisphere (string).
  • easting - Easting from false easting, -500km from central meridian (meter).
  • northing - Northing from equator N or from false northing -10,000km S (meter).
  • band - Optional latitudinal band (string, C..X).
  • datum - This coordinate's datum (Datum).
  • convergence - Optional meridian convergence, bearing of grid North, clockwise from true North (degrees or None).
  • scale - Optional grid scale factor (scalar or None).
Raises:
  • ValueError - Invalid easting or northing.
Overrides: object.__init__

Example:

>>> import pygeodesy
>>> g = pygeodesy.Utm(31, 'N', 448251, 5411932)

parseUTM(self, strUTM)

 

Parses a string to a UTM coordinate.

For more details, see function parseUTM in this module utm.

toLatLon(self, LatLon)

 

Converts this UTM coordinate to an (ellipsoidal) geodetic point.

Parameters:
  • LatLon - LatLon class for the point (LatLon).
Returns:
Point of this UTM coordinate (LatLon).
Raises:
  • TypeError - If LatLon is not ellipsoidal.

Example:

>>> g = Utm(31, 'N', 448251.795, 5411932.678)
>>> from pygeodesy import ellipsoidalVincenty as eV
>>> ll = g.toLatLon(eV.LatLon)  # 48°51′29.52″N, 002°17′40.20″E

toMgrs(self)

 

Converts this UTM coordinate to an MGRS grid reference.

See function toMgrs in module mgrs for more details.

Returns:
The MGRS grid reference (Mgrs).

toStr(self, prec=0, sep=' ', B=False, cs=False)

 

Returns a string representation of this UTM coordinate.

To distinguish from MGRS grid zone designators, a space is left between the zone and the hemisphere.

Note that UTM coordinates are rounded, not truncated (unlike MGRS grid references).

Parameters:
  • prec - Number of decimals, unstripped (int).
  • sep - Separator to join (string).
  • B - Optionally, include latitudinal band (bool).
  • cs - Optionally, include meridian convergence and grid scale factor (bool).
Returns:
This UTM as string "00 N|S meter meter" plus "degrees float" if cs is True (string).
Overrides: bases.Base.toStr

Example:

>>> u = Utm(3, 'N', 448251, 5411932.0001)
>>> u.toStr(4)  # 03 N 448251.0 5411932.0001
>>> u.toStr(sep=', ')  # 03 N, 448251, 5411932

toStr2(self, prec=0, fmt='[%s]', sep=', ', B=False, cs=False)

 

Returns a string representation of this UTM coordinate.

Note that UTM coordinates are rounded, not truncated (unlike MGRS grid references).

Parameters:
  • prec - Number of decimals, unstripped (int).
  • fmt - Enclosing backets format (string).
  • sep - Separator between name:value pairs (string).
  • B - Optionally, include latitudinal band (bool).
  • cs - Optionally, include meridian convergence and grid scale factor (bool).
Returns:
This UTM as "[Z:00, H:N|S, E:meter, N:meter]" string plus "C:degrees, S:float" if cs is True (string).
Overrides: bases.Base.toStr2

Property Details

band

Gets the latitudinal band (C..X or '').

Get Method:
band(self) - Gets the latitudinal band (C..X or '').

convergence

Gets the meridian convergence (degrees or None).

Get Method:
convergence(self) - Gets the meridian convergence (degrees or None).

datum

Gets the datum (Datum).

Get Method:
datum(self) - Gets the datum (Datum).

easting

Gets the easting (meter).

Get Method:
easting(self) - Gets the easting (meter).

hemisphere

Gets the hemisphere (N|S).

Get Method:
hemisphere(self) - Gets the hemisphere (N|S).

northing

Gets the northing (meter).

Get Method:
northing(self) - Gets the northing (meter).

scale

Gets the grid scale (scalar or None).

Get Method:
scale(self) - Gets the grid scale (scalar or None).

zone

Gets the longitudinal zone (1..60).

Get Method:
zone(self) - Gets the longitudinal zone (1..60).