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

Class LatLonSphericalBase

        object --+        
                 |        
        bases.Base --+    
                     |    
bases.LatLonHeightBase --+
                         |
                        LatLonSphericalBase
Known Subclasses:

(INTERNAL) Base class for spherical Latlons.

Instance Methods
 
finalBearingTo(self, other)
Returns the final bearing (reverse azimuth) from this to an other point.
 
maxLat(self, bearing)
Returns maximum latitude reached when travelling on a great circle on given bearing from this point (based on 'Clairaut's formula').
 
minLat(self, bearing)
Returns minimum latitude reached when travelling on a great circle on given bearing from this point.
 
parse(self, strll, height=0, sep=',')
Parses a string representing lat-/longitude point and return a LatLon.
 
rhumbBearingTo(self, other)
Returns 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)
Returns 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)
Returns distance from this to an other point along a rhumb (loxodrome) line.
 
rhumbMidpointTo(self, other, height=None)
Returns the (loxodromic) midpoint between this and an other point.

Inherited from bases.LatLonHeightBase: __eq__, __init__, __ne__, __str__, bounds, copy, equals, isclockwise, points, to2ab, to3llh, to3xyz, toStr

Inherited from bases.Base: __repr__, classname, others, toStr2, topsub

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties
  datum
Gets this point's datum (Datum).
  isellipsoidal
Checks whether this LatLon is ellipsoidal (bool).
  isspherical
Checks whether this LatLon is spherical (bool).

Inherited from bases.LatLonHeightBase: height, lat, lon

Inherited from object: __class__

Method Details

finalBearingTo(self, other)

 

Returns the final bearing (reverse azimuth) from this to an other point.

Parameters:
  • other - The other point (spherical LatLon).
Returns:
Final bearing (compass degrees).
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)

 

Returns 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, it is 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 degrees).
Returns:
Maximum latitude (degrees90).

JS name: maxLatitude.

minLat(self, bearing)

 

Returns minimum latitude reached when travelling on a great circle on given bearing from this point. See method maxLat for more details.

Parameters:
  • bearing - Initial bearing (compass degrees).
Returns:
Minimum latitude (degrees90).

JS name: minLatitude.

parse(self, strll, height=0, sep=',')

 

Parses 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] (string).
  • height - Default height (meter).
  • sep - Separator (string).
Returns:
The point (spherical LatLon).
Raises:
  • ValueError - Invalid strll.

rhumbBearingTo(self, other)

 

Returns 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 degrees).
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)

 

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

Parameters:
  • distance - Distance travelled (same units as radius).
  • bearing - Bearing from this point (compass degrees).
  • radius - Mean earth radius (meter).
  • height - Optional height, overriding the default height (meter or 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)

 

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

Parameters:
  • other - The other point (spherical LatLon).
  • radius - Mean radius of earth (scalar, default meter).
Returns:
Distance (in 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)

 

Returns the (loxodromic) midpoint between this and an other point.

Parameters:
  • other - The other point (spherical LatLon).
  • height - Optional height, overriding the mean height (meter or same unit as radius).
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'


Property Details

datum

Gets this point's datum (Datum).

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

isellipsoidal

Checks whether this LatLon is ellipsoidal (bool).

Get Method:
isellipsoidal(self) - Checks whether this LatLon is ellipsoidal (bool).

isspherical

Checks whether this LatLon is spherical (bool).

Get Method:
isspherical(self) - Checks whether this LatLon is spherical (bool).