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

# Class Numpy2LatLon

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

Wrapper for `NumPy` arrays as "on-the-fly" `LatLon` points.

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

Instance Methods
__init__(self, array, ilat=0, ilon=1, LatLon=None) Handle a `NumPy` array 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` 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
| isNumpy2
Inherited from `_Array2LatLon`: `ilat`, `ilon`, `shape` Inherited from `_Basequence`: `epsilon`, `isPoints2`, `isTuple2` Inherited from `object`: `__class__`

Method Details

### __init__(self, array, ilat=0, ilon=1, LatLon=None) (Constructor) |
Handle a `NumPy` array as a sequence of `LatLon` points. Parameters: `array` - `NumPy` array (`numpy.array`). `ilat` - Optional index of the latitudes column (`int`). `ilon` - Optional index of the longitudes column (`int`). `LatLon` - Optional `LatLon` class to use (LatLon_). Raises: `IndexError` - If `array.shape` is not (1+, 2+). `TypeError` - If `array` is not a `NumPy` array or `LatLon` is not a class with `lat` and `lon` attributes. `ValueError` - If the `ilat` and/or `ilon` values are the same or out of range. Overrides: object.__init__ Example:
    >>> type(array)
    <type 'numpy.ndarray'>  # <class ...> in Python 3+
    >>> points = Numpy2LatLon(array, lat=0, lon=1)
    >>> simply = simplifyRDP(points, ...)
    >>> type(simply)
    <type 'numpy.ndarray'>  # <class ...> in Python 3+
    >>> sliced = points[1:-1]
    >>> type(sliced)
    <class '...Numpy2LatLon'>

Property Details

### isNumpy2 Get method: isNumpy2(self) - Is this a Numpy2 wrapper? Set method: immutable(inst, value) - Throws an `AttributeError`, always.