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

# Class LocalCartesian

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

Known Subclasses:
  - deprecated.EcefCartesian
  - , Ltp

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

The `z` axis is normal to the ellipsoid, the `y` axis points due North. The plane `z = -heighth0` 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, name='') New LocalCartesian converter. |
forward(self, latlonh, lon=None, height=0, M=False) Convert geodetic `(lat, lon, height)` to local cartesian `(x, y, z)`. |
reset(self, latlonh0=0, lon0=0, height0=0, name='') Reset the (geodetic) origin. |
reverse(self, xyz, y=None, z=None, M=False) Convert local `(x, y, z)` to geodetic `(lat, lon, height)`. |
toStr(self, prec=9) Return this LocalCartesian as a string. |
Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others`, `toRepr` Inherited from `named._Named`: `_DOT_`, `attrs`, `classof`, `copy`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| M Get the rotation matrix (`EcefMatrix`).
| datum Get the ECEF converter's datum (Datum).
| ecef Get the ECEF converter (EcefKarney).
| height0 Get origin's height (`meter`).
| lat0 Get origin's latitude (`degrees`).
| lon0 Get origin's longitude (`degrees`).
Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, latlonh0=0, lon0=0, height0=0, ecef=None, name='') (Constructor) |
New LocalCartesian converter. Arguments: `latlonh0` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude of the origin (`degrees`). `lon0` - Optional `scalar` longitude of the origin for `scalar` `latlonh0` (`degrees`). `height0` - Optional origin height (`meter`), vertically above (or below) the surface of the ellipsoid. `ecef` - An ECEF converter (EcefKarney). `name` - Optional name (`str`). Raises: `LocalError` - If `latlonh0` not `LatLon`, Ecef9Tuple, `scalar` or invalid or if `lon0` not `scalar` for `scalar` `latlonh0` or invalid or if `height0` invalid. `TypeError` - Invalid `ecef`, not EcefKarney. Overrides: object.__init__

### forward (self, latlonh, lon=None, height=0, M=False) |
Convert geodetic `(lat, lon, height)` to local cartesian `(x, y, z)`. Arguments: `latlonh` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude (`degrees`). `lon` - Optional `scalar` longitude for `scalar` `latlonh` (`degrees`). `height` - Optional height (`meter`), vertically above (or below) the surface of the ellipsoid. `M` - Optionally, return the rotation EcefMatrix (`bool`). Returns: A Local6Tuple`(x, y, z, ltp, ecef, M)` with the local `(x, y, z)` coordinates, `ecef` converted to this `datum`, this `ltp` and the rotation matrix `M` (EcefMatrix) if requested. Raises: `LocalError` - If `latlonh` not `LatLon`, Ecef9Tuple, `scalar` or invalid or if `lon` not `scalar` for `scalar` `latlonh` or invalid or if `height` invalid. See Also: Note at method EcefKarney.forward.

### reset (self, latlonh0=0, lon0=0, height0=0, name='') |
Reset the (geodetic) origin. Arguments: `latlonh0` - Either a `LatLon`, an Ecef9Tuple or `scalar` latitude of the origin (`degrees`). `lon0` - Optional `scalar` longitude of the origin for `scalar` `latlonh0` (`degrees`). `height0` - Optional origin height (`meter`), vertically above (or below) the surface of the ellipsoid. `name` - Optional, new name (`str`). Raises: `LocalError` - If `latlonh0` not `LatLon`, Ecef9Tuple, `scalar` or invalid or if `lon0` not `scalar` for `scalar` `latlonh0` or invalid or if `height0` invalid.

### reverse (self, xyz, y=None, z=None, M=False) |
Convert local `(x, y, z)` to geodetic `(lat, lon, height)`. Arguments: `xyz` - A local (XyzLocal, Enu, Ned, Aer, Local6Tuple) 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 rotation EcefMatrix (`bool`). Returns: An Ecef9Tuple`(x, y, z, lat, lon, height, C, M, datum)` with the geodetic `lat`, `lon` and `height` plus geocentric `x`, `y` and `z`, case `C`, the rotation matrix `M` if requested and `datum` if available. Raises: `LocalError` - Invalid `xyz` or `scalar` `x` or `y` and/or `z` not `scalar` for `scalar` `xyz`. See Also: Note at method EcefKarney.reverse.

### toStr (self, prec=9) |
Return this LocalCartesian as a string. Arguments: `prec` - Optional precision, number of decimal digits (0..9). Returns: This LocalCartesian representation (`str`). Raises: `AssertionError` - Always, see function notOverloaded. Overrides: named._Named.toStr

Property Details

### M Get the rotation matrix (`EcefMatrix`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### datum Get the ECEF converter's datum (Datum). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### ecef Get the ECEF converter (EcefKarney). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### height0 Get origin's height (`meter`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### lat0 Get origin's latitude (`degrees`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)

### lon0 Get origin's longitude (`degrees`). Get method: _fget(inst) Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst)