Package pygeodesy :: Module points :: Class LatLon_
[frames] | no frames]

Class LatLon_

object --+
         |
        LatLon_

Low-overhead LatLon class for Numpy2LatLon or Tuple2LatLon'

Instance Methods
 
__init__(self, lat, lon)
Creat a new, mininal, low-overhead LatLon_ instance, without heigth and datum.
 
__eq__(self, other)
 
__ne__(self, other)
 
__repr__(self)
repr(x)
 
__str__(self)
str(x)
 
others(self, other, name='other')
Check this and an other instance for type compatiblility.
 
points(self, points, closed=False, base=None)
Check a polygon given as an array, list, sequence, set or tuple of points.
 
to2ab(self)
Return the lat- and longitude in radians.
 
toStr(self, **kwds)
This LatLon_ as a string "<degrees>, <degrees>".
 
toStr2(self, **kwds)
This LatLon_ as a string "class(<degrees>, ...)".

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

Properties
  lat
  lon

Inherited from object: __class__

Method Details

__init__(self, lat, lon)
(Constructor)

 

Creat a new, mininal, low-overhead LatLon_ instance, without heigth and datum.

Parameters:
  • lat - Latitude (degrees).
  • lon - Longitude (degrees).
Overrides: object.__init__

Note: The lat- and longitude are taken as-given, un-clipped and un-validated.

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

others(self, other, name='other')

 

Check this and an other instance for type compatiblility.

Parameters:
  • other - The other instance (any).
  • name - Optional, name for other (string).
Returns:
None.
Raises:
  • TypeError - Mismatch of this and type(other).

points(self, points, closed=False, base=None)

 

Check a polygon given as an array, list, sequence, set or tuple of points.

Parameters:
  • points - The points of the polygon (LatLon[])
  • closed - Optionally, treat polygon as closed and remove any duplicate or closing final points (bool).
  • base - Optional points base class (None).
Returns:
2-Tuple (number, sequence) of points (int, sequence).
Raises:
  • TypeError - Some points are not LatLon.
  • ValueError - Too few points.

to2ab(self)

 

Return the lat- and longitude in radians.

Returns:
2-Tuple (lat, lon) in (radians, radians).

toStr(self, **kwds)

 

This LatLon_ as a string "<degrees>, <degrees>".

Parameters:
  • kwds - Optional, keyword arguments.
Returns:
Instance (string).

toStr2(self, **kwds)

 

This LatLon_ as a string "class(<degrees>, ...)".

Parameters:
  • kwds - Optional, keyword arguments.
Returns:
Class instance (string).