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

Class LatLonSphericalBase

   object --+            
            |            
 named._Named --+        
                |        
 named._NamedBase --+    
                    |    
latlonBase.LatLonBase --+
                        |
                       LatLonSphericalBase
Known Subclasses:

(INTERNAL) Base class for spherical LatLons.

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, strllh, height=0, sep=',', name='')
Parse a string representing a similar, spherical LatLon point, consisting of "lat, lon[, height]".
 
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.771415, 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.771415)
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: PointsIter, __eq__, __ne__, __str__, _distanceTo_, antipode, bounds, boundsOf, chordTo, compassAngle, compassAngleTo, cosineAndoyerLambertTo, cosineForsytheAndoyerLambertTo, cosineLawTo, destinationXyz, equals, equals3, equirectangularTo, euclideanTo, flatLocalTo, flatPolarTo, haversineTo, heightStr, hubenyTo, isantipode, isantipodeTo, isequalTo, isequalTo3, latlon2, latlon2round, latlon_, philam2, points, points2, thomasTo, to2ab, to3llh, to3xyz, toCartesian, toEcef, toLocal, toLtp, toStr, toVector, toVector3d, vincentysTo

Inherited from named._NamedBase: __repr__, 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
  datum
Property to get and set this point's datum (Datum).

Inherited from latlonBase.LatLonBase: Ecef, height, isEllipsoidal, isSpherical, lam, lat, latlon, latlonheight, lon, phi, philam, philamheight, xyz, xyzh

Inherited from named._Named: classname, classnaming, 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

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.

JS name: maxLatitude.

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.

JS name: minLatitude.

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 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:

rhumbBearingTo (self, other)

 

Return the initial bearing (forward azimuth) from this to an other point along a rhumb (loxodrome) line.

Arguments:
  • 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.771415, height=None)

 

Return the destination point having travelled along a rhumb (loxodrome) line from this point the given distance on the given bearing.

Arguments:
  • 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).
Raises:
  • ValueError - Invalid distance, bearing, radius or height.

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.771415)

 

Return the distance from this to an other point along a rhumb (loxodrome) line.

Arguments:
  • other - The other point (spherical LatLon).
  • radius - Mean earth radius (meter) or None.
Returns:
Distance (meter, the same units as radius or radians if radius is None).
Raises:
  • TypeError - The other point is not spherical.
  • ValueError - Invalid radius.

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.

Arguments:
  • 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.
  • ValueError - Invalid height.

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=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 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.