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

Class Utm

   object --+            
            |            
 named._Named --+        
                |        
 named._NamedBase --+    
                    |    
utmupsBase.UtmUpsBase --+
                        |
                       Utm
Known Subclasses:

Universal Transverse Mercator (UTM) coordinate.

Instance Methods
 
__eq__(self, other)
 
__init__(self, zone, hemisphere, easting, northing, band='', datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran..., falsed=True, convergence=None, scale=None, name='')
New Utm UTM coordinate.
 
__repr__(self)
Default repr(self).
 
__str__(self)
Default str(self).
 
parse(self, strUTM, name='')
Parse a string to a similar Utm instance.
 
parseUTM(self, strUTM)
DEPRECATED, use method Utm.parse.
 
toEtm(self)
Copy this UTM to an ETM coordinate.
 
toLatLon(self, LatLon=None, eps=2.22044604925e-16, unfalse=True, **LatLon_kwds)
Convert this UTM coordinate to an (ellipsoidal) geodetic point.
 
toMgrs(self, center=False)
Convert this UTM coordinate to an MGRS grid reference.
 
toRepr(self, prec=0, fmt='[%s]', sep=', ', B=False, cs=False, **unused)
Return a string representation of this UTM coordinate.
 
toStr(self, prec=0, sep=' ', B=False, cs=False)
Return a string representation of this UTM coordinate.
 
toUps(self, pole='', eps=2.22044604925e-16, falsed=True, **unused)
Convert this UTM coordinate to a UPS coordinate.
 
toUtm(self, zone, eps=2.22044604925e-16, falsed=True, **unused)
Convert this UTM coordinate to a different zone.

Inherited from utmupsBase.UtmUpsBase: eastingnorthing2, to2en, toEpsg

Inherited from named._NamedBase: others

Inherited from named._Named: __imatmul__, __matmul__, __rmatmul__, attrs, classof, copy, dup, rename, toStr2

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

Properties
  band
(INTERNAL) Class property with retrievable name.
  falsed2
Get the easting and northing falsing (EasNor2Tuple(easting, northing)).
  pole
Get the top center of (stereographic) projection, "" always.
  zone
Get the (longitudinal) zone (int, 1..60).

Inherited from utmupsBase.UtmUpsBase: convergence, datum, easting, eastingnorthing, falsed, hemisphere, northing, scale, scale0

Inherited from named._NamedBase: iteration

Inherited from named._Named: classname, classnaming, name, named, named2, named3, named4

Inherited from object: __class__

Method Details

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

 

New Utm UTM coordinate.

Arguments:
  • zone - Longitudinal UTM zone (int, 1..60) or zone with/-out latitudinal Band letter (str, '01C'|..|'60X').
  • hemisphere - Northern or southern hemisphere (str, 'N[orth]' or 'S[outh]').
  • easting - Easting, see falsed (meter).
  • northing - Northing, see falsed (meter).
  • band - Optional, latitudinal band (str, 'C'|..|'X').
  • datum - Optional, this coordinate's datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple).
  • falsed - If True, both easting and northing are falsed (bool).
  • convergence - Optional meridian convergence, bearing off grid North, clockwise from true North (degrees) or None.
  • scale - Optional grid scale factor (scalar) or None.
  • name - Optional name (str).
Raises:
  • TypeError - Invalid datum.
  • UTMError - Invalid zone, hemishere, easting, northing, band, convergence or scale.
Overrides: object.__init__

Example:

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

__repr__ (self)
(Representation operator)

 

Default repr(self).

Overrides: object.__repr__
(inherited documentation)

__str__ (self)
(Informal representation operator)

 

Default str(self).

Overrides: object.__str__
(inherited documentation)

parse (self, strUTM, name='')

 

Parse a string to a similar Utm instance.

Arguments:
  • strUTM - The UTM coordinate (str), see function parseUTM5.
  • name - Optional instance name (str), overriding this name.
Returns:
The similar instance (Utm).
Raises:

See Also: Functions pygeodesy.parseUPS5 and pygeodesy.parseUTMUPS5.

parseUTM (self, strUTM)

 

DEPRECATED, use method Utm.parse.

Decorators:
  • @deprecated_method

toEtm (self)

 

Copy this UTM to an ETM coordinate.

Returns:
The ETM coordinate (Etm).

toLatLon (self, LatLon=None, eps=2.22044604925e-16, unfalse=True, **LatLon_kwds)

 

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

Arguments:
  • LatLon - Optional, ellipsoidal class to return the geodetic point (LatLon) or None.
  • eps - Optional convergence limit, EPS or above (float).
  • unfalse - Unfalse easting and northing if falsed (bool).
  • LatLon_kwds - Optional, additional LatLon keyword arguments, ignored if LatLon is None.
Returns:
This UTM as (LatLon) or if LatLon is None, as LatLonDatum5Tuple(lat, lon, datum, convergence, scale).
Raises:
  • TypeError - Invalid datum or LatLon is not ellipsoidal.
  • UTMError - Invalid meridional radius or H-value.

Example:

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

toMgrs (self, center=False)

 

Convert this UTM coordinate to an MGRS grid reference.

Arguments:
  • center - If True, un-center this UTM to its lowerleft (bool) or by center meter (scalar).
Returns:
The MGRS grid reference (Mgrs).

See Also: Function pygeodesy.toMgrs in module mgrs for more details.

Note: If not specified, the latitudinal band is computed from the (geodetic) latitude and the datum.

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

 

Return a string representation of this UTM coordinate.

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

Arguments:
  • prec - Number of (decimal) digits, unstripped (int).
  • fmt - Enclosing backets format (str).
  • sep - Optional separator between name:value pairs (str).
  • B - Optionally, include latitudinal band (bool).
  • cs - Optionally, include meridian convergence and grid scale factor (bool or non-zero int to specify the precison like prec).
Returns:
This UTM as a string "[Z:09[band], H:N|S, E:meter, N:meter]" plus ", C:degrees, S:float" if cs is True (str).
Overrides: named._Named.toRepr

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

 

Return 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).

Arguments:
  • prec - Number of (decimal) digits, unstripped (int).
  • sep - Optional separator to join (str) or None to return an unjoined tuple of strs.
  • B - Optionally, include latitudinal band (bool).
  • cs - Optionally, include meridian convergence and grid scale factor (bool or non-zero int to specify the precison like prec).
Returns:
This UTM as a string with zone[band], hemisphere, easting, northing, [convergence, scale] in "00 N|S meter meter" plus " degrees float" if cs is True (str).
Overrides: named._Named.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

toUps (self, pole='', eps=2.22044604925e-16, falsed=True, **unused)

 

Convert this UTM coordinate to a UPS coordinate.

Arguments:
  • pole - Optional top/center of the UPS projection, (str, 'N[orth]'|'S[outh]').
  • eps - Optional convergence limit, EPS or above (float), see method Utm.toLatLon.
  • falsed - False both easting and northing (bool).
Returns:
The UPS coordinate (Ups).

toUtm (self, zone, eps=2.22044604925e-16, falsed=True, **unused)

 

Convert this UTM coordinate to a different zone.

Arguments:
  • zone - New UTM zone (int).
  • eps - Optional convergence limit, EPS or above (float), see method Utm.toLatLon.
  • falsed - False both easting and northing (bool).
Returns:
The UTM coordinate (Utm).

Property Details

band

(INTERNAL) Class property with retrievable name.

Get method:
band(self) - Get the latitudinal band ('C'|..|'X').
Set method:
band(self, band) - Set or reset the latitudinal band.

falsed2

Get the easting and northing falsing (EasNor2Tuple(easting, northing)).

Get method:
falsed2(self) - Get the easting and northing falsing (EasNor2Tuple(easting, northing)).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

pole

Get the top center of (stereographic) projection, "" always.

Get method:
pole(self) - Get the top center of (stereographic) projection, "" always.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

zone

Get the (longitudinal) zone (int, 1..60).

Get method:
zone(self) - Get the (longitudinal) zone (int, 1..60).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.