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. |
intersecant2(self, circle, point, bearing, radius=6371008.771415, exact=False, height=None, wrap=True) Compute the intersections of a circle and a line. |
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, strllh, height=0, sep=',', name='') Parse a string representing a similar, spherical `LatLon` point, consisting of `"lat, lon[, height]"`. |
rhumbAzimuthTo(self, other, radius=6371008.771415, exact=False) Return the azimuth (bearing) of a rhumb line (loxodrome) between this and an other (spherical) point. |
rhumbBearingTo(self, other) DEPRECATED, use method `.rhumbAzimuthTo`. |
rhumbDestination(self, distance, bearing, radius=6371008.771415, height=None, exact=False) Return the destination point having travelled the given distance from this point along a rhumb line (loxodrome) at the given bearing. |
rhumbDistanceTo(self, other, radius=6371008.771415, exact=False) Return the distance from this to an other point along a rhumb line (loxodrome). |
rhumbMidpointTo(self, other, height=None, radius=6371008.771415, exact=False, fraction=0.5) Return the (loxodromic) midpoint on the rhumb line 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`: `PointsIter`, `__eq__`, `__ne__`, `__str__`, `antipode`, `bounds`, `boundsOf`, `chordTo`, `circin6`, `circum3`, `circum4_`, `compassAngle`, `compassAngleTo`, `cosineAndoyerLambertTo`, `cosineForsytheAndoyerLambertTo`, `cosineLawTo`, `destinationXyz`, `equals`, `equals3`, `equirectangularTo`, `euclideanTo`, `flatLocalTo`, `flatPolarTo`, `hartzell`, `haversineTo`, `height4`, `heightStr`, `hubenyTo`, `isantipode`, `isantipodeTo`, `isequalTo`, `isequalTo3`, `latlon2`, `latlon2round`, `latlon_`, `nearestOn6`, `normal`, `philam2`, `points`, `points2`, `radii11`, `rhumbLine`, `thomasTo`, `to2ab`, `to3llh`, `to3xyz`, `toCartesian`, `toEcef`, `toLocal`, `toLtp`, `toStr`, `toVector`, `toVector3d`, `vincentysTo` Inherited from `named._NamedBase`: `__repr__`, `others`, `toRepr` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| datum Class `property` with retrievable name.
Inherited from `latlonBase.LatLonBase`: `Ecef`, `height`, `isEllipsoidal`, `isEllipsoidalLatLon`, `isSpherical`, `isnormal`, `lam`, `lat`, `latlon`, `latlonheight`, `lon`, `phi`, `philam`, `philamheight`, `xyz`, `xyzh` Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4` 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. Arguments: `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, spherical datum to use (Datum, Ellipsoid, Ellipsoid2, a_f2Tuple) or `scalar` earth radius). `name` - Optional name (string). Returns: New instance (`LatLon`). Raises: `TypeError` - If `datum` invalid or not 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. Arguments: `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. Arguments: `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

### intersecant2 (self, circle, point, bearing, radius=6371008.771415, exact=False, height=None, wrap=True) |
Compute the intersections of a circle and a line. Arguments: `circle` - Radius of the circle centered at this location (`meter`, same units as `radius`) or a point on the circle (this `LatLon`). `point` - An other point inside the circle (this `LatLon`). `bearing` - Bearing at the `point` (compass `degrees360`) or a second point on the line (this `LatLon`). `radius` - Mean earth radius (`meter`, conventionally). `exact` - If `True` use the exact rhumb methods for azimuth, destination and distance, if `False` use the basic rhumb methods (`bool`) or if `None` use the great circle methods. `height` - Optional height for the intersection points (`meter`, conventionally) or `None`. `wrap` - Wrap and unroll longitudes (`bool`). Returns: 2-Tuple of the intersection points (representing a chord), each an instance of this class. For a tangent line, each point `is` this very instance. Raises: `IntersectionError` - The `point` is outside the `circle`, too distance from the center. `TypeError` - If `point` is not this `LatLon` or `circle` or `bearing` invalid. `ValueError` - Invalid `circle`, `bearing`, `radius`, `exact` or `height`.

### 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). Arguments: `bearing` - Initial bearing (compass `degrees360`). Returns: Maximum latitude (`degrees90`). Raises: `ValueError` - Invalid `bearing`.

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

### parse (self, strllh, height=0, sep=',', name='') |
Parse a string representing a similar, spherical `LatLon` point, consisting of `"lat, lon[, height]"`. Arguments: `strllh` - Lat, lon and optional height (`str`), see function pygeodesy.parse3llh. `height` - Optional, default height (`meter`). `sep` - Optional separator (`str`). `name` - Optional instance name (`str`), overriding this name. Returns: The similar point (spherical `LatLon`). Raises: `ParseError` - Invalid `strllh`.

### rhumbAzimuthTo (self, other, radius=6371008.771415, exact=False) |
Return the azimuth (bearing) of a rhumb line (loxodrome) between this and an other (spherical) point. Arguments: `other` - The other point (spherical `LatLon`). `radius` - Earth radius (`meter`) or earth model (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `exact` - If `True`, use class Rhumb (`bool`), default `False` for backward compatibility. Returns: Rhumb line azimuth (compass `degrees180`). Raises: `TypeError` - The `other` point is incompatible or `radius` is invalid. Overrides: latlonBase.LatLonBase.rhumbAzimuthTo Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = LatLon(50.964, 1.853)
    >>> b = p.rhumbBearingTo(q)  # 116.7

### rhumbBearingTo (self, other) |
DEPRECATED, use method `.rhumbAzimuthTo`. Decorators: `@deprecated_method`

### rhumbDestination (self, distance, bearing, radius=6371008.771415, height=None, exact=False) |
Return the destination point having travelled the given distance from this point along a rhumb line (loxodrome) at the given bearing. Arguments: `distance` - Distance travelled (`meter`, same units as `radius`), may be negative if `exact=True`. `bearing` - Bearing (azimuth) at this point (compass `degrees360`). `radius` - Earth radius (`meter`) or earth model (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple) if `exact=True`. `height` - Optional height, overriding the default height (`meter`, same unit as `radius`). `exact` - If `True`, use class Rhumb (`bool`), default `False` for backward compatibility. Returns: The destination point (spherical `LatLon`). Raises: `ValueError` - Invalid `distance`, `bearing`, `radius` or `height`. Overrides: latlonBase.LatLonBase.rhumbDestination Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = p.rhumbDestination(40300, 116.7)  # 50.9642°N, 001.8530°E

### rhumbDistanceTo (self, other, radius=6371008.771415, exact=False) |
Return the distance from this to an other point along a rhumb line (loxodrome). Arguments: `other` - The other point (spherical `LatLon`). `radius` - Earth radius (`meter`) or earth model (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple) if `exact=True`. `exact` - If `True`, use class Rhumb (`bool`), default `False` for backward compatibility. Returns: Distance (`meter`, the same units as `radius` or `radians` if `radius` is `None`). Raises: `TypeError` - The `other` point is incompatible. `ValueError` - Invalid `radius`. Overrides: latlonBase.LatLonBase.rhumbDistanceTo Example:
    >>> p = LatLon(51.127, 1.338)
    >>> q = LatLon(50.964, 1.853)
    >>> d = p.rhumbDistanceTo(q)  # 403100

### rhumbMidpointTo (self, other, height=None, radius=6371008.771415, exact=False, fraction=0.5) |
Return the (loxodromic) midpoint on the rhumb line between this and an other point. Arguments: `other` - The other point (spherical LatLon). `height` - Optional height, overriding the mean height (`meter`). `radius` - Optional mean earth radius (`meter`), overriding the default `R_M`. `radius` - Earth radius (`meter`) or earth model (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple). `exact` - If `True`, use class Rhumb (`bool`), default `False` for backward compatibility. `fraction` - Midpoint location from this point (`scalar`), may negative if `exact=True`. Returns: The (mid)point at the given `fraction` along the rhumb line (spherical `LatLon`). Raises: `TypeError` - The `other` point is incompatible. `ValueError` - Invalid `height` or `fraction` Overrides: latlonBase.LatLonBase.rhumbMidpointTo 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. Arguments: `Nvector_kwds` - Optional, additional `Nvector` keyword arguments, ignored if `Nvector is 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. Arguments: `radius` - Optional earth radius (`meter`). Returns: The WM coordinate (Wm). See Also: Function pygeodesy.toWm in module webmercator for details.

Property Details

### datum Class `property` with retrievable name. Get method: datum(self) - Get this point's datum (Datum). Set method: datum(self, datum) - Set this point's datum without conversion (Datum, Ellipsoid, Ellipsoid2, a_f2Tuple) or `scalar` spherical earth radius).