toUtm8 (latlon,
lon=None,
datum=None,
Utm=<class 'pygeodesy.utm.Utm'>,
falsed=True,
name='',
strict=True,
zone=None,
**cmoff)
|
|
Convert a lat-/longitude point to a UTM coordinate.
- Arguments:
latlon - Latitude (degrees) or an (ellipsoidal) geodetic
LatLon point.
lon - Optional longitude (degrees) or None.
datum - Optional datum for this UTM coordinate, overriding
latlon's datum (Datum,
Ellipsoid, Ellipsoid2 or a_f2Tuple).
Utm - Optional class to return the UTM coordinate (Utm) or
None.
falsed - False both easting and northing (bool).
name - Optional Utm name (str).
strict - Restrict lat to UTM ranges
(bool).
zone - Optional UTM zone to enforce (int or
str).
cmoff - DEPRECATED, use falsed. Offset longitude
from the zone's central meridian (bool).
- Returns:
- The UTM coordinate (
Utm) or if
Utm is None or not
falsed, a UtmUps8Tuple(zone, hemipole, easting,
northing, band, datum, gamma, scale). The
hemipole is the 'N'|'S' hemisphere.
- Raises:
RangeError - If lat outside the valid UTM bands or if
lat or lon outside the
valid range and pygeodesy.rangerrors set to True.
TypeError - Invalid datum or latlon not
ellipsoidal.
UTMError - Invalid zone.
ValueError - If lon value is missing or if
latlon is invalid.
Note:
Implements Karney’s method, using 8-th order Krüger series, giving
results accurate to 5 nm (or better) for distances up to 3,900 Km
from the central meridian.
Example:
>>> p = LatLon(48.8582, 2.2945)
>>> u = toUtm(p)
>>> p = LatLon(13.4125, 103.8667)
>>> u = toUtm(p)
|