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: __imatmul__, __matmul__, __rmatmul__, attrs, classof, copy, dup, methodname, rename, renamed, toStr2

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

Properties
  datum
  ellipsoid
  latlon
  philam
  radius
  x
  y

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

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:
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:
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:

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:
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 strs.
  • 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:
Overrides: named._Named.toStr

Property Details

datum

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

ellipsoid

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

latlon

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

philam

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

radius

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

x

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

y

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.