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

# Class Utm

     object --+
              |
    bases.Named --+
                  |
        bases.Based --+
                      |
                     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, name=`'````'`) New UTM coordinate. |
copy(self) Copy this UTM coordinate. |
parseUTM(self, strUTM) Parse a string to a UTM coordinate. |
toLatLon(self, LatLon=None, eps=2.22044604925e-16) Convert this UTM coordinate to an (ellipsoidal) geodetic point. |
toMgrs(self) Convert this UTM coordinate to an MGRS grid reference. |
toStr(self, prec=0, sep=`'``` `'`, B=False, cs=False) Return a string representation of this UTM coordinate. |
toStr2(self, prec=0, fmt=`'``[%s]``'`, sep=`'``,` `'`, B=False, cs=False) Return a string representation of this UTM coordinate. |
Inherited from `bases.Based`: `__repr__`, `__str__`, `classof`, `others` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| band Get the latitudinal band (C..X or '').
| convergence Get the meridian convergence (`degrees` or `None`).
| datum Get the datum (Datum).
| easting Get the easting (`meter`).
| hemisphere Get the hemisphere (N|S).
| northing Get the northing (`meter`).
| scale Get the grid scale (`scalar` or `None`).
| zone Get the longitudinal zone (1..60).
Inherited from `bases.Named`: `classname`, `classnaming`, `name` 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, name=`'````'`) (Constructor) |
New UTM coordinate. Parameters: `zone` - UTM 6° longitudinal zone (`int`, 1..60 covering 180°W..180°E) or '00B' (`str`) zone and band letter. `hemisphere` - N for the northern or S for the southern hemisphere (`str`). `easting` - Easting from false easting (`meter`), -500km from central meridian. `northing` - Northing from equator (`meter`), N or from false northing -10,000km S. `band` - Optional, latitudinal band (string, C..X). `datum` - Optional, 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`). `name` - Optional name (`str`). Raises: `RangeError` - If easting or northing is outside the valid UTM range. `UTMError` - Invalid band, hemishere or zone. Overrides: object.__init__ Example:
    >>> import pygeodesy
    >>> u = pygeodesy.Utm(31, 'N', 448251, 5411932)

### copy(self) |
Copy this UTM coordinate. Returns: The copy (Utm or subclass thereof). Overrides: bases.Named.copy

### parseUTM(self, strUTM) |
Parse a string to a UTM coordinate. For more details, see function parseUTM in this module utm.

### toLatLon(self, LatLon=None, eps=2.22044604925e-16) |
Convert this UTM coordinate to an (ellipsoidal) geodetic point. Parameters: `LatLon` - Optional, ellipsoidal (sub-)class to use for the point (`LatLon`) or `None`. `eps` - Optional convergence limit, EPS or above (`float`). Returns: This UTM coordinate as (LatLon) or 5-tuple (lat, lon, datum, convergence, scale) if LatLon is `None`. Raises: `TypeError` - If 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) |
Convert 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) |
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). Parameters: `prec` - Optional number of decimals, unstripped (`int`). `sep` - Optional separator to join (`str`). `B` - Optionally, include latitudinal band (`bool`). `cs` - Optionally, include meridian convergence and grid scale factor (`bool`). Returns: This UTM as a string with zone[, band], hemisphere, eastring, northing, [convergence, scale] in `"00 N|S meter meter"` plus `" degrees float"` if cs is `True` (`str`). Overrides: bases.Based.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) |
Return a string representation of this UTM coordinate. Note that UTM coordinates are rounded, not truncated (unlike MGRS grid references). Parameters: `prec` - Optional number of decimals, unstripped (`int`). `fmt` - Optional, 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`). Returns: This UTM as a string `"[Z:00, H:N|S, E:meter, N:meter]"` plus `"C:degrees, S:float"` if cs is `True` (`str`). Overrides: bases.Based.toStr2

Property Details

### band Get the latitudinal band (C..X or ''). Get Method: band(self) - Get the latitudinal band (C..X or ''). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### convergence Get the meridian convergence (`degrees` or `None`). Get Method: convergence(self) - Get the meridian convergence (`degrees` or `None`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### datum Get the datum (Datum). Get Method: datum(self) - Get the datum (Datum). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### easting Get the easting (`meter`). Get Method: easting(self) - Get the easting (`meter`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### hemisphere Get the hemisphere (N|S). Get Method: hemisphere(self) - Get the hemisphere (N|S). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### northing Get the northing (`meter`). Get Method: northing(self) - Get the northing (`meter`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### scale Get the grid scale (`scalar` or `None`). Get Method: scale(self) - Get the grid scale (`scalar` or `None`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### zone Get the longitudinal zone (1..60). Get Method: zone(self) - Get the longitudinal zone (1..60). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.