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

# Class Tuple2LatLon

           object --+
                    |
        _abcoll.Sized --+
                        |
           object --+   |
                    |   |
     _abcoll.Iterable --+
                        |
           object --+   |
                    |   |
    _abcoll.Container --+
                        |
         _abcoll.Sequence --+
                            |
                  _Basequence --+
                                |
                    _Array2LatLon --+
                                    |
                                   Tuple2LatLon

Wrapper for tuple sequences as "on-the-fly" `LatLon` points.

Nested Classes
Inherited from `_abcoll.Sized`: `__metaclass__`

Instance Methods
__init__(self, tuples, ilat=0, ilon=1, LatLon=None) Handle a list of tuples, each containing a lat- and longitude and perhaps other values as a sequence of `LatLon` points. |
Inherited from `_Array2LatLon`: `__contains__`, `__getitem__`, `__iter__`, `__len__`, `__repr__`, `__reversed__`, `__str__`, `count`, `find`, `findall`, `index`, `point`, `rfind`, `subset` Inherited from `_Basequence`: `copy`, `dup` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`

Class Methods
Inherited from `_abcoll.Sized`: `__subclasshook__`

Class Variables
Inherited from `_Array2LatLon`: `__abstractmethods__`

Properties
| isTuple2
Inherited from `_Array2LatLon`: `ilat`, `ilon`, `shape` Inherited from `_Basequence`: `epsilon`, `isNumpy2`, `isPoints2` Inherited from `object`: `__class__`

Method Details

### __init__ (self, tuples, ilat=0, ilon=1, LatLon=None) (Constructor) |
Handle a list of tuples, each containing a lat- and longitude and perhaps other values as a sequence of `LatLon` points. Arguments: `tuples` - The `list`, `tuple` or `sequence` of tuples (`tuple`[]). `ilat` - Optional index of the latitudes value (`int`). `ilon` - Optional index of the longitudes value (`int`). `LatLon` - Optional `LatLon` class to use (LatLon_). Raises: `IndexError` - If `(len(tuples), min(len(t) for t in tuples))` is not (1+, 2+). `TypeError` - If `tuples` is not a `list`, `tuple` or `sequence` or if `LatLon` is not a `LatLon` with `lat`, `lon` and `name` attributes. `ValueError` - If the `ilat` and/or `ilon` values are the same or out of range. Overrides: object.__init__ Example:
    >>> tuples = [(0, 1), (2, 3), (4, 5)]
    >>> type(tuples)
    <type 'list'>  # <class ...> in Python 3+
    >>> points = Tuple2LatLon(tuples, lat=0, lon=1)
    >>> simply = simplifyRW(points, 0.5, ...)
    >>> type(simply)
    <type 'list'>  # <class ...> in Python 3+
    >>> simply
    [(0, 1), (4, 5)]
    >>> sliced = points[1:-1]
    >>> type(sliced)
    <class '...Tuple2LatLon'>
    >>> sliced
    ...Tuple2LatLon([(2, 3), ...][1], ilat=0, ilon=1)
    >>> closest, _ = nearestOn2(LatLon_(2, 1), points, adjust=False)
    >>> closest
    LatLon_(lat=1.0, lon=2.0)
    >>> closest, _ = nearestOn2(LatLon_(3, 2), points)
    >>> closest
    LatLon_(lat=2.001162, lon=3.001162)

Property Details

### isTuple2 Get method: isTuple2(self) - Is this a Tuple2 wrapper? Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.