Package pygeodesy :: Module sphericalBase :: Class LatLonSphericalBase |
[frames] | no frames]

# Class LatLonSphericalBase

       object --+
                |
     named._Named --+
                    |
     named._NamedBase --+
                        |
    latlonBase.LatLonBase --+
                            |
                           LatLonSphericalBase

Known Subclasses:
  - sphericalNvector.LatLon
  - , sphericalTrigonometry.LatLon

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

Instance Methods
__init__(self, lat, lon, height=0, datum=None, name=`'````'`) Create a spherical `LatLon` point frome the given lat-, longitude and height on the given datum. |
bearingTo2(self, other, wrap=False, raiser=False) Return the initial and final bearing (forward and reverse azimuth) from this to an other point. |
finalBearingTo(self, other, wrap=False, raiser=False) Return the final bearing (reverse azimuth) from this to an other point. |
maxLat(self, bearing) Return the maximum latitude reached when travelling on a great circle on given bearing from this point based on Clairaut's formula. |
minLat(self, bearing) Return the minimum latitude reached when travelling on a great circle on given bearing from this point. |
parse(self, strll, height=0, sep=`'``,``'`) Parse a string representing lat-/longitude point and return a `LatLon`. |
rhumbBearingTo(self, other) Return the initial bearing (forward azimuth) from this to an other point along a rhumb (loxodrome) line. |
rhumbDestination(self, distance, bearing, radius=6371008.77141, height=None) Return the destination point having travelled along a rhumb (loxodrome) line from this point the given distance on the given bearing. |
rhumbDistanceTo(self, other, radius=6371008.77141) Return the distance from this to an other point along a rhumb (loxodrome) line. |
rhumbMidpointTo(self, other, height=None) Return the (loxodromic) midpoint between this and an other point. |
toNvector(self, Nvector=<class 'pygeodesy.nvectorBase.NvectorBase'>, **Nvector_kwds) Convert this point to `Nvector` components, including height. |
toWm(self, radius=6378137.0) Convert this point to a WM coordinate. |
Inherited from `latlonBase.LatLonBase`: `__eq__`, `__ne__`, `__str__`, `antipode`, `bounds`, `boundsOf`, `compassAngle`, `compassAngleTo`, `equals`, `equals3`, `equirectangularTo`, `euclideanTo`, `haversineTo`, `isantipode`, `isantipodeTo`, `isequalTo`, `isequalTo3`, `latlon2`, `latlon2round`, `latlon_`, `philam2`, `points`, `points2`, `to2ab`, `to3llh`, `to3xyz`, `toCartesian`, `toEcef`, `toStr`, `toVector`, `toVector3d`, `vincentysTo` Inherited from `named._NamedBase`: `__repr__`, `others`, `toStr2` Inherited from `named._Named`: `_dot_`, `attrs`, `classof`, `copy` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| datum Property to get and set this point's datum (Datum).
| isEllipsoidal
| isSpherical
Inherited from `latlonBase.LatLonBase`: `Ecef`, `height`, `lam`, `lat`, `latlon`, `latlonheight`, `lon`, `phi`, `philam`, `philamheight`, `xyz`, `xyzh` Inherited from `named._Named`: `classname`, `classnaming`, `name`, `named`, `named2` Inherited from `object`: `__class__`

Method Details

### __init__(self, lat, lon, height=0, datum=None, name=`'````'`) (Constructor) |
Create a spherical `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, shperical datum to use (Datum). `name` - Optional name (string). Returns: New instance (`LatLon`). Raises: `TypeError` - `datum` is not a datum or not spherical. Overrides: object.__init__ Example:
    >>> p = LatLon(51.4778, -0.0016)  # height=0, datum=Datums.WGS84

### bearingTo2(self, other, wrap=False, raiser=False) |
Return the initial and final bearing (forward and reverse azimuth) from this to an other point. Parameters: `other` - The other point (`LatLon`). `wrap` - Wrap and unroll longitudes (`bool`). `raiser` - Optionally, raise CrossError (`bool`). Returns: A Bearing2Tuple`(initial, final)`. Raises: `TypeError` - The other point is not spherical. See Also: Methods `initialBearingTo` and `finalBearingTo`.

### finalBearingTo(self, other, wrap=False, raiser=False) |
Return the final bearing (reverse azimuth) from this to an other point. Parameters: `other` - The other point (spherical `LatLon`). `wrap` - Wrap and unroll longitudes (`bool`). `raiser` - Optionally, raise CrossError (`bool`). Returns: Final bearing (compass `degrees360`). Raises: `TypeError` - The other point is not spherical. Example:
    >>> p = LatLon(52.205, 0.119)
    >>> q = LatLon(48.857, 2.351)
    >>> b = p.finalBearingTo(q)  # 157.9

### maxLat(self, bearing) |
Return the maximum latitude reached when travelling on a great circle on given bearing from this point based on Clairaut's formula. The maximum latitude is independent of longitude and the same for all points on a given latitude. Negate the result for the minimum latitude (on the Southern hemisphere). Parameters: `bearing` - Initial bearing (compass `degrees360`). Returns: Maximum latitude (`degrees90`). JS name: maxLatitude.

### minLat(self, bearing) |
Return the minimum latitude reached when travelling on a great circle on given bearing from this point. Parameters: `bearing` - Initial bearing (compass `degrees360`). Returns: Minimum latitude (`degrees90`). See Also: Method maxLat for more details. JS name: minLatitude.

### parse(self, strll, height=0, sep=`'``,``'`) |
Parse a string representing lat-/longitude point and return a `LatLon`. 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 module dms. Parameters: `strll` - Lat, lon [, height] (`str`). `height` - Optional , default height (`meter`). `sep` - Optional separator (`str`). Returns: The point (spherical `LatLon`). Raises: `ValueError` - Invalid strll.

### rhumbBearingTo(self, other) |
Return the initial bearing (forward azimuth) from this to an other point along a rhumb (loxodrome) line. Parameters: `other` - The other point (spherical `LatLon`). Returns: Initial bearing (compass `degrees360`). Raises: `TypeError` - The other point is not spherical. Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = LatLon(50.964, 1.853)
    >>> b = p.rhumbBearingTo(q)  # 116.7

### rhumbDestination(self, distance, bearing, radius=6371008.77141, height=None) |
Return the destination point having travelled along a rhumb (loxodrome) line from this point the given distance on the given bearing. Parameters: `distance` - Distance travelled (`meter`, same units as radius). `bearing` - Bearing from this point (compass `degrees360`). `radius` - Mean earth radius (`meter`). `height` - Optional height, overriding the default height (`meter`, same unit as radius). Returns: The destination point (spherical `LatLon`). Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = p.rhumbDestination(40300, 116.7)  # 50.9642°N, 001.8530°E
JS name: rhumbDestinationPoint

### rhumbDistanceTo(self, other, radius=6371008.77141) |
Return the distance from this to an other point along a rhumb (loxodrome) line. Parameters: `other` - The other point (spherical `LatLon`). `radius` - Mean earth radius (`meter`). Returns: Distance (`meter`, the same units as radius). Raises: `TypeError` - The other point is not spherical. Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = LatLon(50.964, 1.853)
    >>> d = p.rhumbDistanceTo(q)  # 403100

### rhumbMidpointTo(self, other, height=None) |
Return the (loxodromic) midpoint between this and an other point. Parameters: `other` - The other point (spherical LatLon). `height` - Optional height, overriding the mean height (`meter`). Returns: The midpoint (spherical `LatLon`). Raises: `TypeError` - The other point is not spherical. Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = LatLon(50.964, 1.853)
    >>> m = p.rhumb_midpointTo(q)
    >>> m.toStr()  # '51.0455°N, 001.5957°E'

### toNvector(self, Nvector=<class 'pygeodesy.nvectorBase.NvectorBase'>, **Nvector_kwds) |
Convert this point to `Nvector` components, including height. Parameters: `Nvector_kwds` - Optional, additional `Nvector` keyword arguments, ignored if `Nvector=None`. Returns: An `Nvector` or a Vector4Tuple`(x, y, z, h)` if `Nvector` is `None`. Raises: `TypeError` - Invalid `Nvector` or `Nvector_kwds`. Overrides: latlonBase.LatLonBase.toNvector

### toWm(self, radius=6378137.0) |
Convert this point to a WM coordinate. Parameters: `radius` - Optional earth radius (`meter`). Returns: The WM coordinate (Wm). See Also: Function toWm in module webmercator for details.

Property Details

### datum Property to get and set 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 Get method: isEllipsoidal(self) - Check whether this `LatLon` is ellipsoidal (`bool`). Set method: immutable(inst, value) - Throws an `AttributeError`, always.

### isSpherical Get method: isSpherical(self) - Check whether this `LatLon` is spherical (`bool`). Set method: immutable(inst, value) - Throws an `AttributeError`, always.