Package pygeodesy :: Module ellipsoidalBase :: Class LatLonEllipsoidalBase |
[frames] | no frames]

# Class LatLonEllipsoidalBase

        object --+
                 |
       bases.Named --+
                     |
           bases.Based --+
                         |
    bases.LatLonHeightBase --+
                             |
                            LatLonEllipsoidalBase

Known Subclasses:
  - ellipsoidalKarney.LatLon
  - , ellipsoidalNvector.LatLon
  - , ellipsoidalVincenty.LatLon

(INTERNAL) Base class for ellipsoidal `LatLon`s.

Instance Methods
__init__(self, lat, lon, height=0, datum=None, name=`'````'`) Create an (ellipsoidal) `LatLon` point frome the given lat-, longitude and height on the given datum. |
antipode(self, height=None) Return the antipode, the point diametrically opposite to this point. |
convertDatum(self, datum) Convert this `LatLon` point to a new datum. |
distanceTo2(self, other) Approximate the distance and bearing between this and an other (ellipsoidal) point based on the radii of curvature. |
elevation2(self, adjust=True, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) Return elevation of this point for its or the given datum. |
ellipsoid(self, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`) Return the ellipsoid of this point's datum or the given datum. |
ellipsoids(self, other) Check the type and ellipsoid of this and an other point's datum. |
geoidHeight2(self, adjust=False, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) Return geoid height of this point for its or the given datum. |
parse(self, strll, height=0, datum=None, sep=`'``,``'`) Parse a string representing this `LatLon` point. |
to3xyz(self) Convert this (ellipsoidal) geodetic `LatLon` point to (geocentric) cartesian x/y/z components. |
toOsgr(self) Convert this `LatLon` point to an OSGR coordinate. |
toUtm(self) Convert this `LatLon` point to a UTM coordinate. |
toWm(self) Convert this `LatLon` point to a WM coordinate. |
Inherited from `bases.LatLonHeightBase`: `__eq__`, `__ne__`, `__str__`, `bounds`, `compassAngle`, `compassAngleTo`, `copy`, `equals`, `equals3`, `equirectangularTo`, `haversineTo`, `isantipode`, `isantipodeTo`, `isequalTo`, `isequalTo3`, `latlon2`, `latlon2round`, `latlon_`, `points`, `points2`, `to2ab`, `to3llh`, `toStr` Inherited from `bases.Based`: `__repr__`, `classof`, `others`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| convergence Get this point's UTM meridian convergence (`degrees`) or `None` if not converted from Utm.
| datum Get this point's datum (Datum).
| isEllipsoidal Check whether this `LatLon` point is ellipsoidal (`bool`).
| isSpherical Check whether this `LatLon` point is spherical (`bool`).
| scale Get this point's UTM grid scale factor (`float`) or `None` if not converted from Utm.
Inherited from `bases.LatLonHeightBase`: `height`, `lat`, `latlon`, `lon` Inherited from `bases.Named`: `classname`, `classnaming`, `name` Inherited from `object`: `__class__`

Method Details

### __init__(self, lat, lon, height=0, datum=None, name=`'````'`) (Constructor) |
Create an (ellipsoidal) `LatLon` point frome the given lat-, longitude and height on the given datum. Parameters: `lat` - Latitude (`degrees` or DMS `[N|S]`). `lon` - Longitude (`degrees` or DMS `str[E|W]`). `height` - Optional elevation (`meter`, the same units as the datum's half-axes). `datum` - Optional datum to use (Datum). `name` - Optional name (string). Returns: New instance (`LatLon`). Raises: `RangeError` - Value of lat or lon outside the valid range and rangerrrors set to `True`. `ValueError` - Invalid lat or lon. Overrides: object.__init__ Example:
    >>> p = LatLon(51.4778, -0.0016)  # height=0, datum=Datums.WGS84

### antipode(self, height=None) |
Return the antipode, the point diametrically opposite to this point. Parameters: `height` - Optional height of the antipode, height of this point otherwise (`meter`). Returns: The antipodal point (`LatLon`). Overrides: bases.LatLonHeightBase.antipode

### convertDatum(self, datum) |
Convert this `LatLon` point to a new datum. Parameters: `datum` - Datum to convert to (Datum). Returns: The converted point (ellipsoidal `LatLon`). Example:
    >>> pWGS84 = LatLon(51.4778, -0.0016)  # default Datums.WGS84
    >>> pOSGB  = pWGS84.convertDatum(Datums.OSGB36)  # 51.477284°N, 000.00002°E

### distanceTo2(self, other) |
Approximate the distance and bearing between this and an other (ellipsoidal) point based on the radii of curvature. Suitable only for short distances up to a few hundred Km or Miles and only between non-near-polar points. Parameters: `other` - The other point (`LatLon`). Returns: 2-Tuple (distance, bearing) in (`meter`, `degrees360`). Raises: `TypeError` - The other point is not `LatLon`. `ValueError` - Incompatible datum ellipsoids. See Also: Method Ellipsoid.distance2 and Local, flat earth approximation.

### elevation2(self, adjust=True, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) |
Return elevation of this point for its or the given datum. Parameters: `adjust` - Adjust the elevation for datums other than `NAD83`. `datum` - Optional datum (Datum). `timeout` - Optional query timeout (seconds). Returns: 2-Tuple (elevation, data_source) in (`meter`, `str`) or in case of errors (`None`, <error>). Notes: The adjustment applied the is difference in geocentric earth radius for the datum used and `NAV83` upon which elevation2 is based. NED elevation is only available for locations in the Conterminous US (CONUS). See Also: Function elevation2 and method Ellipsoid.Rgeocentric for further details.

### ellipsoid(self, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`) |
Return the ellipsoid of this point's datum or the given datum. Parameters: `datum` - Optional datum (Datum). Returns: The ellipsoid (Ellipsoid).

### ellipsoids(self, other) |
Check the type and ellipsoid of this and an other point's datum. Parameters: `other` - The other point (`LatLon`). Returns: This point's datum ellipsoid (Ellipsoid). Raises: `TypeError` - The other point is not `LatLon`. `ValueError` - Incompatible datum ellipsoids.

### geoidHeight2(self, adjust=False, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran`...`, timeout=2) |
Return geoid height of this point for its or the given datum. Parameters: `adjust` - Adjust the geoid height for datums other than `NAD83/NADV88`. `datum` - Optional datum (Datum). `timeout` - Optional query timeout (seconds). Returns: 2-Tuple (height, model_name) in (`meter`, `str`) or in case of errors (`None`, <error>). Notes: The adjustment applied the is difference in geocentric earth radius for the datum used and `NAV83/NADV88` upon which geoidHeight2 is based. NGS geoid height is only available for locations in the Conterminous US (CONUS). See Also: Function geoidHeight2 and method Ellipsoid.Rgeocentric for further details.

### parse(self, strll, height=0, datum=None, sep=`'``,``'`) |
Parse a string representing this `LatLon` point. The lat- and longitude must be separated by a sep[arator] character. If height is present it must follow and be separated by another sep[arator]. Lat- and longitude may be swapped, provided at least one ends with the proper compass direction. For more details, see functions parse3llh and parseDMS in sub-module dms. Parameters: `strll` - Lat, lon [, height] (string). `height` - Optional, default height (`meter` or `None`). `datum` - Optional, default datum (Datum). `sep` - Optional separator (string). Returns: The point (LatLonEllipsoidalBase). Raises: `ValueError` - Invalid strll.

### to3xyz(self) |
Convert this (ellipsoidal) geodetic `LatLon` point to (geocentric) cartesian x/y/z components. Returns: 3-Tuple (x, y, z) in (`meter`). Overrides: bases.LatLonHeightBase.to3xyz

### toOsgr(self) |
Convert this `LatLon` point to an OSGR coordinate. See function toOsgr in module osgr for details. Returns: The OSGR coordinate (Osgr).

### toUtm(self) |
Convert this `LatLon` point to a UTM coordinate. See function toUtm in module utm for details. Returns: The UTM coordinate (Utm).

### toWm(self) |
Convert this `LatLon` point to a WM coordinate. See function toWm in module webmercator for details. Returns: The WM coordinate (Wm).

Property Details

### convergence Get this point's UTM meridian convergence (`degrees`) or `None` if not converted from Utm. Get Method: convergence(self) - Get this point's UTM meridian convergence (`degrees`) or `None` if not converted from Utm. Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### datum Get this point's datum (Datum). Get Method: datum(self) - Get this point's datum (Datum). Set Method: datum(self, datum) - Set this point's datum without conversion.

### isEllipsoidal Check whether this `LatLon` point is ellipsoidal (`bool`). Get Method: isEllipsoidal(self) - Check whether this `LatLon` point is ellipsoidal (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isSpherical Check whether this `LatLon` point is spherical (`bool`). Get Method: isSpherical(self) - Check whether this `LatLon` point is spherical (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### scale Get this point's UTM grid scale factor (`float`) or `None` if not converted from Utm. Get Method: scale(self) - Get this point's UTM grid scale factor (`float`) or `None` if not converted from Utm. Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.