Package pygeodesy :: Module ltp :: Class LocalCartesian
[frames] | no frames]

Class LocalCartesian

  object --+        
           |        
named._Named --+    
               |    
named._NamedBase --+
                   |
                  LocalCartesian
Known Subclasses:

Conversion between geodetic (lat, lon, height) and local cartesian (x, y, z) coordinates with geodetic origin (lat0, lon0, height0), transcoded from Karney's C++ class LocalCartesian.

The z axis is normal to the ellipsoid, the y axis points due North. The plane z = -height0 is tangent to the ellipsoid.

The conversions all take place via geocentric coordinates using a geocentric EcefKarney, by default the WGS84 datum/ellipsoid.


See Also: Class Ltp.

Instance Methods
 
__init__(self, latlonh0=0, lon0=0, height0=0, ecef=None, **lon00_name)
New LocalCartesian converter.
 
__eq__(self, other)
Compare this and an other instance.
 
forward(self, latlonh, lon=None, height=0, M=False, **name)
Convert geodetic (lat, lon, height) to local cartesian (x, y, z).
 
reset(self, latlonh0=0, lon0=0, height0=0, ecef=None, **lon00_name)
Reset this converter, see LocalCartesian.__init__ for more details.
 
reverse(self, xyz, y=None, z=None, M=False, **lon00_name)
Convert local (x, y, z) to geodetic (lat, lon, height).
 
toStr(self, prec=9, **unused)
Return this LocalCartesian as a string.

Inherited from named._NamedBase: __repr__, __str__, others, toRepr

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
  ecef
  ellipsoid
  height0
  lat0
  latlonheight0
  lon0
  lon00
  M

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

Inherited from object: __class__

Method Details

__init__ (self, latlonh0=0, lon0=0, height0=0, ecef=None, **lon00_name)
(Constructor)

 

New LocalCartesian converter.

Arguments:
  • latlonh0 - The (geodetic) origin (LatLon, LatLon4Tuple, Ltp LocalCartesian or Ecef9Tuple) or the scalar latitude of the (goedetic) origin (degrees).
  • lon0 - Longitude of the (goedetic) origin (degrees), required if latlonh0 is scalar, ignored otherwise.
  • height0 - Optional height (meter, conventionally) at the (goedetic) origin perpendicular to and above (or below) the ellipsoid's surface, like lon0.
  • ecef - An ECEF converter (EcefKarney only), like lon0.
  • lon00_name - Optional name=NN (str) and keyword argument lon00=lon0 for the arbitrary polar longitude (degrees), see method reverse and property lon00 for further details.
Raises:
Overrides: object.__init__

Note: If Blatlonh0 is an Ltp or LocalCartesian, only lat0, lon0, height0 and polar lon00 are copied, not the ECEF converter.

__eq__ (self, other)
(Equality operator)

 

Compare this and an other instance.

Arguments:
Returns:
True if equal, False otherwise.

forward (self, latlonh, lon=None, height=0, M=False, **name)

 

Convert geodetic (lat, lon, height) to local cartesian (x, y, z).

Arguments:
  • latlonh - Either a LatLon, Ltp, Ecef9Tuple or scalar (geodetic) latitude (degrees).
  • lon - Optional scalar (geodetic) longitude for scalar latlonh (degrees).
  • height - Optional height (meter, conventionally) perpendicular to and above (or below) the ellipsoid's surface.
  • M - Optionally, return the concatenated rotation EcefMatrix, iff available (bool).
  • name - Optional name=NN (str).
Returns:
A Local9Tuple(x, y, z, lat, lon, height, ltp, ecef, M) with local x, y, z, geodetic (lat, lon, height, this ltp, ecef (Ecef9Tuple) with geocentric x, y, z (and geodetic lat, lon, height) and the concatenated rotation matrix M (EcefMatrix) if requested.
Raises:
  • LocalError - If latlonh not scalar, LatLon, Ltp, Ecef9Tuple or invalid or if lon not scalar for scalar latlonh or invalid or if height invalid.

reverse (self, xyz, y=None, z=None, M=False, **lon00_name)

 

Convert local (x, y, z) to geodetic (lat, lon, height).

Arguments:
  • xyz - A local (XyzLocal, Enu, Ned, Aer, Local9Tuple) or local x coordinate (scalar).
  • y - Local y coordinate for scalar xyz and z (meter).
  • z - Local z coordinate for scalar xyz and y (meter).
  • M - Optionally, return the concatenated rotation EcefMatrix, iff available (bool).
  • lon00_name - Optional name=NN (str) and keyword argument lon00=lon0 for the arbitrary polar longitude (degrees), overriding see the property lon00=lon0 value. The polar longitude (degrees) is returned with polar latitudes abs(lat0) == 90 for local x=0 and y=0 locations.
Returns:
An Local9Tuple(x, y, z, lat, lon, height, ltp, ecef, M) with local x, y, z, geodetic lat, lon, height, this ltp, an ecef (Ecef9Tuple) with the geocentric x, y, z (and geodetic lat, lon, height) and the concatenated rotation matrix M (EcefMatrix) if requested.
Raises:
  • LocalError - Invalid xyz or scalar x or y and/or z not scalar for scalar xyz.

toStr (self, prec=9, **unused)

 

Return this LocalCartesian as a string.

Arguments:
  • prec - Precision, number of (decimal) digits (0..9).
Returns:
This LocalCartesian representation (str).
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.

ecef

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.

height0

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.

lat0

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.

latlonheight0

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.

lon0

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.

lon00

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

M

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.