Package pygeodesy :: Module webmercator :: Class Wm |
[frames] | no frames]

# Class Wm

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
                      Wm

Web Mercator (WM) coordinate.

Instance Methods
__init__(self, x, y, earth=6378137.0, **name_radius) New Wm Web Mercator (WM) coordinate. |
latlon2(self, datum=None) Convert this WM coordinate to a lat- and longitude. |
parse(self, strWM, **name) Parse a string to a similar Wm instance. |
parseWM(self, strWM, name='') DEPRECATED, use method Wm.parse. |
to2ll(self, datum=None) DEPRECATED, use method `latlon2`. |
toLatLon(self, LatLon=None, datum=None, **LatLon_kwds) Convert this WM coordinate to a geodetic point. |
toRepr(self, prec=3, fmt='[%s]', sep=', ', radius=False, **unused) Return a string representation of this WM coordinate. |
toStr(self, prec=3, fmt='F', sep=' ', radius=False, **unused) Return a string representation of this WM coordinate. |
Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others` Inherited from `named._Named`: `__format__`, `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `renamed`, `toStr2` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| datum Get the datum (`Datum`).
| ellipsoid Get the ellipsoid (`Ellipsoid`).
| latlon Get the lat- and longitude (LatLon2Tuple).
| philam Get the lat- and longitude ((PhiLam2Tuple).
| radius Get the earth radius (`meter`).
| x Get the easting (`meter`).
| y Get the northing (`meter`).
Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4`, `sizeof`, `typename` Inherited from `object`: `__class__`

Method Details

### __init__ (self, x, y, earth=6378137.0, **name_radius) (Constructor) |
New Wm Web Mercator (WM) coordinate. Arguments: `x` - Easting from central meridian (`meter`). `y` - Northing from equator (`meter`). `earth` - Earth radius (`meter`), datum or ellipsoid (Datum, a_f2Tuple, Ellipsoid or Ellipsoid2). `name_radius` - Optional `name=NN` (`str`) and DEPRECATED keyword argument `radius=earth`, use `earth`. Raises: `WebMercatorError` - Invalid `x`, `y` or `radius`. Overrides: object.__init__ Note: WM is strictly defined for spherical and WGS84 ellipsoidal earth models only.

### latlon2 (self, datum=None) |
Convert this WM coordinate to a lat- and longitude. Arguments: `datum` - Optional datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple) or earth radius (`meter`), overriding this WM's `radius` and `datum`. Returns: A LatLon2Tuple`(lat, lon)`. Raises: `TypeError` - Invalid or non-ellipsoidal `datum`. Note: WM is strictly defined for spherical and WGS84 ellipsoidal earth models only. See Also: Method `toLatLon` for other return types.

### parse (self, strWM, **name) |
Parse a string to a similar Wm instance. Arguments: `strWM` - The WM coordinate (`str`), see function parseWM. `name` - Optional `name=NN` (`str`), overriding this name. Returns: The similar instance (Wm). Raises: `WebMercatorError` - Invalid `strWM`.

### parseWM (self, strWM, name='') |
DEPRECATED, use method Wm.parse. Decorators: `@deprecated_method`

### to2ll (self, datum=None) |
DEPRECATED, use method `latlon2`. Returns: A LatLon2Tuple`(lat, lon)`. Decorators: `@deprecated_method`

### toLatLon (self, LatLon=None, datum=None, **LatLon_kwds) |
Convert this WM coordinate to a geodetic point. Arguments: `LatLon` - Ellipsoidal or sphperical `LatLon` class to return the geodetic point (`LatLon`) or `None`. `datum` - Optional, datum (`Datum`) overriding this WM's. `LatLon_kwds` - Optional, additional `LatLon` keyword arguments, ignored if `LatLon is None`. Returns: This WM coordinate as `LatLon` or if `LatLon is None` a LatLonDatum3Tuple. Raises: `TypeError` - If `datum` is invalid or if `LatLon` and `datum` are incompatible.

### toRepr (self, prec=3, fmt='[%s]', sep=', ', radius=False, **unused) |
Return a string representation of this WM coordinate. Arguments: `prec` - Number of (decimal) digits, unstripped (`int`). `fmt` - Enclosing backets format (`str`). `sep` - Optional separator between name:value pairs (`str`). `radius` - If `True`, include the radius (`bool`) or `scalar` to override this WM's radius. Returns: This WM as "[x:meter, y:meter]" (`str`) or as "[x:meter, y:meter], radius:meter]" if `radius` is `True` or `scalar`. Raises: `WebMercatorError` - Invalid `radius`. Overrides: named._Named.toRepr

### toStr (self, prec=3, fmt='F', sep=' ', radius=False, **unused) |
Return a string representation of this WM coordinate. Arguments: `prec` - Number of (decimal) digits, unstripped (`int`). `fmt` - Optional `float` format (`letter`). `sep` - Optional separator to join (`str`) or `None` to return an unjoined `tuple` of `str`s. `radius` - If `True`, include the radius (`bool`) or `scalar` to override this WM's radius. Returns: This WM as "meter meter" (`str`) or as "meter meter radius" if `radius` is `True` or `scalar`. Raises: `WebMercatorError` - Invalid `radius`. Overrides: named._Named.toStr

Property Details

### datum Get the datum (`Datum`). Get method: datum(self) - Get the datum (`Datum`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### ellipsoid Get the ellipsoid (`Ellipsoid`). Get method: ellipsoid(self) - Get the ellipsoid (`Ellipsoid`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### latlon Get the lat- and longitude (LatLon2Tuple). Get method: latlon(self) - Get the lat- and longitude (LatLon2Tuple). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### philam Get the lat- and longitude ((PhiLam2Tuple). Get method: philam(self) - Get the lat- and longitude ((PhiLam2Tuple). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### radius Get the earth radius (`meter`). Get method: radius(self) - Get the earth radius (`meter`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### x Get the easting (`meter`). Get method: x(self) - Get the easting (`meter`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### y Get the northing (`meter`). Get method: y(self) - Get the northing (`meter`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.