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

Class LatLon_

object --+
         |
        LatLon_
Known Subclasses:

Low-overhead LatLon class for Numpy2LatLon and Tuple2LatLon.

Instance Methods
 
__init__(self, latlonh, lon=None, name='', height=0, datum=None, wrap=False)
Creat a new, mininal, low-overhead LatLon_ instance.
 
__eq__(self, other)
 
__ne__(self, other)
 
__repr__(self)
repr(x)
 
__str__(self)
str(x)
 
classof(self, *args, **kwds)
Instantiate this very class.
 
copy(self, deep=False)
Make a shallow or deep copy of this instance.
 
dup(self, **items)
Duplicate this instance, replacing some items.
 
heightStr(self, prec=-2)
Return a string for the height height.
 
intermediateTo(self, other, fraction, height=None, wrap=False)
Locate the point at a given fraction between (or along) this and an other point.
 
isequalTo(self, other, eps=None)
Compare this point with an other point, ignoring height.
 
others(self, *other, **name_other_up)
Refined class comparison.
 
normal(self)
Normalize this point in-place to abs(lat) <= 90 and abs(lon) <= 180.
 
points(self, points, closed=False, base=None)
DEPRECATED, use method points2.
 
points2(self, points, closed=False, base=None)
Check a path or polygon represented by points.
 
PointsIter(self, points, loop=0, dedup=False)
Return a points iterator.
 
to2ab(self)
DEPRECATED, use property philam.
 
toNormal(self, deep=False, name='')
Get a copy of this point normalized to abs(lat) <= 90 and abs(lon) <= 180.
 
toNvector(self, h=None, Nvector=<class 'pygeodesy.nvectorBase.NvectorBase'>, **Nvector_kwds)
Convert this point to n-vector (normal to the earth's surface) components, including height.
 
toRepr(self, **kwds)
This LatLon_ as a string "class(<degrees>, ...)".
 
toStr(self, form='d', joined=', ', **prec_sep_s_D_M_S_kwds)
Convert this point to a "lat, lon[, height][, name][, ...]" string, formatted in the given format.
 
toStr2(self, **kwds)
DEPRECATED, used method toRepr.

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

Properties
  isEllipsoidal
Check whether this point is ellipsoidal (bool or None if unknown).
  isEllipsoidalLatLon
Get LatLon base.
  isnormal
Return True if this point is normal (bool), meaning abs(lat) <= 90 and abs(lon) <= 180.
  isSpherical
Check whether this point is spherical (bool or None if unknown).
  lam
Get the longitude (radians).
  latlon
Get the lat- and longitude in degrees (LatLon2Tuple(lat, lon)).
  latlonheight
Get the lat-, longitude and height (LatLon3Tuple(lat, lon, height)).
  phi
Get the latitude (radians).
  philam
Get the lat- and longitude (PhiLam2Tuple(phi, lam)).
  philamheight
Get the lat-, longitude in radians and height (PhiLam3Tuple(phi, lam, height)).

Inherited from object: __class__

Method Details

__init__ (self, latlonh, lon=None, name='', height=0, datum=None, wrap=False)
(Constructor)

 

Creat a new, mininal, low-overhead LatLon_ instance.

Arguments:
  • latlonh - Latitude (degrees or DMS str with N or S suffix) or a previous LatLon instance provided lon=None.
  • lon - Longitude (degrees or DMS str with E or W suffix) or C(None), indicating latlonh is a LatLon.
  • name - Optional name (str).
  • height - Optional height (meter, conventionally).
  • datum - Optional datum (Datum, Ellipsoid, Ellipsoid2, a_f2Tuple or scalar radius) or None.
  • wrap - If True, wrap or normalize lat and lon (bool).
Raises:
  • TypeError - Invalid datum or latlonh not a LatLon.
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)

classof (self, *args, **kwds)

 

Instantiate this very class.

Arguments:
  • args - Optional, positional arguments.
  • kwds - Optional, keyword arguments.
Returns:
New instance (self.__class__).

copy (self, deep=False)

 

Make a shallow or deep copy of this instance.

Arguments:
  • deep - If True make a deep, otherwise a shallow copy (bool).
Returns:
The copy (This (sub-)class).

dup (self, **items)

 

Duplicate this instance, replacing some items.

Arguments:
  • items - Attributes to be changed (any).
Returns:
The duplicate (This (sub-)class).
Raises:
  • AttributeError - Some items invalid.

heightStr (self, prec=-2)

 

Return a string for the height height.

Arguments:
  • prec - Number of (decimal) digits, unstripped (int).

See Also: Function pygeodesy.hstr.

intermediateTo (self, other, fraction, height=None, wrap=False)

 

Locate the point at a given fraction between (or along) this and an other point.

Arguments:
  • other - The other point (LatLon).
  • fraction - Fraction between both points (float, 0.0 for this and 1.0 for the other point).
  • height - Optional height (meter), overriding the intermediate height.
  • wrap - If True, wrap or normalize and unroll the other point (bool).
Returns:
Intermediate point (this LatLon).
Raises:
  • TypeError - Incompatible other type.

isequalTo (self, other, eps=None)

 

Compare this point with an other point, ignoring height.

Arguments:
  • other - The other point (LatLon).
  • eps - Tolerance for equality (degrees).
Returns:
True if both points are identical, ignoring height, False otherwise.
Raises:

others (self, *other, **name_other_up)

 

Refined class comparison.

Arguments:
  • other - The other instance (any type).
  • name_other_up - Overriding name=other and up=1 keyword arguments.
Returns:
The other if compatible.
Raises:
  • TypeError - Incompatible other type.

normal (self)

 

Normalize this point in-place to abs(lat) <= 90 and abs(lon) <= 180.

Returns:
True if this point was normal, False if it wasn't (but is now).

See Also: Property isnormal and method toNormal.

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

 

DEPRECATED, use method points2.

Decorators:
  • @deprecated_method

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

 

Check a path or polygon represented by points.

Arguments:
  • points - The path or polygon points (LatLon[])
  • closed - Optionally, consider the polygon closed, ignoring any duplicate or closing final points (bool).
  • base - Optionally, check all points against this base class, if None don't check.
Returns:
A Points2Tuple(number, points) with the number of points and the points list or tuple.
Raises:
  • PointsError - Insufficient number of points.
  • TypeError - Some points are not base.

PointsIter (self, points, loop=0, dedup=False)

 

Return a points iterator.

Arguments:
  • points - The path or polygon points (LatLon[])
  • loop - Number of loop-back points (non-negative int).
  • dedup - Skip duplicate points (bool).
Returns:
A new PointsIter iterator.
Raises:

to2ab (self)

 

DEPRECATED, use property philam.

Decorators:
  • @deprecated_method

toNormal (self, deep=False, name='')

 

Get a copy of this point normalized to abs(lat) <= 90 and abs(lon) <= 180.

Arguments:
  • deep - If True make a deep, otherwise a shallow copy (bool).
  • name - Optional name of the copy (str).
Returns:
A copy of this point, normalized and optionally renamed (LatLon).

See Also: Property isnormal, method normal and function pygeodesy.normal.

toNvector (self, h=None, Nvector=<class 'pygeodesy.nvectorBase.NvectorBase'>, **Nvector_kwds)

 

Convert this point to n-vector (normal to the earth's surface) components, including height.

Arguments:
  • h - Optional height, overriding this point's height (meter).
  • Nvector - Optional class to return the n-vector components (Nvector) or None.
  • Nvector_kwds - Optional, additional Nvector keyword arguments, ignored if Nvector is None.
Returns:
The n-vector components Nvector or if Nvector is None, a Vector4Tuple(x, y, z, h).
Raises:
  • TypeError - Invalid Nvector or Nvector_kwds argument.

toRepr (self, **kwds)

 

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

Arguments:
  • kwds - Optional, keyword arguments.
Returns:
Class instance (str).

toStr (self, form='d', joined=', ', **prec_sep_s_D_M_S_kwds)

 

Convert this point to a "lat, lon[, height][, name][, ...]" string, formatted in the given format.

Arguments:
  • form - The lat-/longitude format to use (str), see functions pygeodesy.latDMS or pygeodesy.lonDMS.
  • joined - Separator to join the lat-, longitude, heigth, name and other strings (str or None or NN for non-joined).
  • prec_sep_s_D_M_S_kwds - Optional precision, separator, s_D, s_M, s_S, s_DMS and possibly other keyword arguments, see functions pygeodesy.latDMS or pygeodesy.lonDMS.
Returns:
This point in the specified format, etc. (str or a 2- or 3+tuple (lat_str, lon_str[, height_str][, name_str][, ...]) if joined=NN or joined=None and with the height_str and name_str only included if non-zero respectively non-empty).

See Also: Function pygeodesy.latDMS or pygeodesy.lonDMS for more details about keyword arguments format, precision, separator, s_D, s_M, s_S and s_DMS.

toStr2 (self, **kwds)

 

DEPRECATED, used method toRepr.

Decorators:
  • @deprecated_method

Property Details

isEllipsoidal

Check whether this point is ellipsoidal (bool or None if unknown).

Get method:
isEllipsoidal(self) - Check whether this point is ellipsoidal (bool or None if unknown).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

isEllipsoidalLatLon

Get LatLon base.

Get method:
isEllipsoidalLatLon(self) - Get LatLon base.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

isnormal

Return True if this point is normal (bool), meaning abs(lat) <= 90 and abs(lon) <= 180.

Get method:
isnormal(self) - Return True if this point is normal (bool), meaning abs(lat) <= 90 and abs(lon) <= 180.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

See Also: Methods normal, toNormal and functions pygeodesy.isnormal and pygeodesy.normal.

isSpherical

Check whether this point is spherical (bool or None if unknown).

Get method:
isSpherical(self) - Check whether this point is spherical (bool or None if unknown).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

lam

Get the longitude (radians).

Get method:
lam(self) - Get the longitude (radians).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

latlon

Get the lat- and longitude in degrees (LatLon2Tuple(lat, lon)).

Get method:
latlon(self) - Get the lat- and longitude in degrees (LatLon2Tuple(lat, lon)).
Set method:
latlon(self, latlon) - Set the lat- and longitude.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

latlonheight

Get the lat-, longitude and height (LatLon3Tuple(lat, lon, height)).

Get method:
latlonheight(self) - Get the lat-, longitude and height (LatLon3Tuple(lat, lon, height)).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

phi

Get the latitude (radians).

Get method:
phi(self) - Get the latitude (radians).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

philam

Get the lat- and longitude (PhiLam2Tuple(phi, lam)).

Get method:
philam(self) - Get the lat- and longitude (PhiLam2Tuple(phi, lam)).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

philamheight

Get the lat-, longitude in radians and height (PhiLam3Tuple(phi, lam, height)).

Get method:
philamheight(self) - Get the lat-, longitude in radians and height (PhiLam3Tuple(phi, lam, height)).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.