toWm(latlon,
lon=None,
radius=6378137.0,
Wm=<class 'pygeodesy.webmercator.Wm'>,
name='
' )
|
|
Convert a lat-/longitude point to a WM coordinate.
- Parameters:
latlon - Latitude (degrees ) or an (ellipsoidal or spherical)
geodetic LatLon point.
lon - Optional longitude (degrees or None ).
radius - Optional earth radius (meter ).
Wm - Optional (sub-)class to return the WM coordinate (Wm)
or None .
name - Optional name (str ).
- Returns:
- The WM coordinate (
Wm ) or an EasNorRadius3Tuple(easting, northing,
radius) if Wm is None .
- Raises:
ValueError - If lon value is missing, if
latlon is not scalar, if
latlon is beyond the valid WM range and rangerrors is set to True or if
radius is invalid.
Example:
>>> p = LatLon(48.8582, 2.2945)
>>> w = toWm(p)
>>> p = LatLon(13.4125, 103.8667)
>>> w = toWm(p)
|