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

Class LatLonEllipsoidalBase

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

(INTERNAL) Base class for ellipsoidal LatLons.

Instance Methods
 
__init__(self, lat, lon, height=0, datum=None)
Create an (ellipsoidal) LatLon point frome the given lat-, longitude and height (elevation, altitude) on a given datum.
 
convertDatum(self, datum)
Convert this point to a new coordinate system.
 
copy(self)
Copy this point.
 
ellipsoid(self, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran...)
Return the ellipsoid of this or the given datum.
 
ellipsoids(self, other)
Check the type and ellipsoid of this and an other datum.
 
parse(self, strll, height=0, datum=None, sep=',')
Parse a string representing lat-/longitude point.
 
to3xyz(self)
Convert this (ellipsoidal) geodetic LatLon point to (geocentric) cartesian x/y/z components.
 
toOsgr(self)
Convert this lat-/longitude to an OSGR coordinate.
 
toUtm(self)
Convert this lat-/longitude to a UTM coordinate.

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

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

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

Properties
  datum
Gets this point's datum (Datum).
  isEllipsoidal
Check whether this LatLon is ellipsoidal (bool).
  isSpherical
Check whether this LatLon is spherical (bool).

Inherited from bases.LatLonHeightBase: height, lat, lon

Inherited from object: __class__

Method Details

__init__(self, lat, lon, height=0, datum=None)
(Constructor)

 

Create an (ellipsoidal) LatLon point frome the given lat-, longitude and height (elevation, altitude) on a given datum.

Parameters:
  • lat - Latitude (degrees or DMS string with N or S suffix).
  • lon - Longitude (degrees or DMS string with E or W suffix).
  • height - Elevation (meter or the same units as datum's half-axes).
  • datum - Datum to use (Datum).
Returns:
New instance (LatLon).
Raises:
  • ValueError - Invalid lat or lon.
Overrides: object.__init__

Example:

>>> p = LatLon(51.4778, -0.0016)  # height=0, datum=Datums.WGS84

convertDatum(self, datum)

 

Convert this point to a new coordinate system.

Parameters:
  • datum - Datum to convert to (Datum).
Returns:
The converted point (LatLonEllipsoidalBase).

Example:

>>> pWGS84 = LatLon(51.4778, -0.0016)  # default Datums.WGS84
>>> pOSGB  = pWGS84.convertDatum(Datums.OSGB36)  # 51.477284°N, 000.00002°E

copy(self)

 

Copy this point.

Returns:
Copy of this point (LatLonEllipsoidalBase).
Overrides: bases.LatLonHeightBase.copy

ellipsoid(self, datum=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran...)

 

Return the ellipsoid of this 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 datum.

Parameters:
  • other - The other datum (Datum).
Returns:
This datum's ellipsoid (Ellipsoid).
Raises:
  • TypeError - The other point is not LatLon.
  • ValueError - If datum ellipsoids are incompatible.

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

 

Parse a string representing lat-/longitude 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 - Default height (meter or None).
  • datum - Default datum (Datum).
  • sep - 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 lat-/longitude to an OSGR coordinate.

See function toOsgr in sub-module osgr for more details.

Returns:
The OSGR coordinate (Osgr).

toUtm(self)

 

Convert this lat-/longitude to a UTM coordinate.

See function toUtm in sub-module utm for more details.

Returns:
The UTM coordinate (Utm).

Property Details

datum

Gets this point's datum (Datum).

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

isEllipsoidal

Check whether this LatLon is ellipsoidal (bool).

Get Method:
isEllipsoidal(self) - Check whether this LatLon is ellipsoidal (bool).

isSpherical

Check whether this LatLon is spherical (bool).

Get Method:
isSpherical(self) - Check whether this LatLon is spherical (bool).