Package pygeodesy :: Module iters :: Class LatLon2PsxyIter |
[frames] | no frames]

# Class LatLon2PsxyIter

      object --+
               |
    named._Named --+
                   |
           _BaseIter --+
                       |
              PointsIter --+
                           |
                          LatLon2PsxyIter

Iterate and convert for `points` with optional loop-back and copies.

Instance Methods
__init__(self, points, loop=0, base=None, wrap=True, radius=None, dedup=False, **name) New LatLon2PsxyIter iterator. |
__getitem__(self, index) Get the point(s) at the given `index` or `slice`. |
enumerate(self, closed=False, copies=False) Iterate and yield each point as a 2-tuple `(index, Point3Tuple)`. |
iterate(self, closed=False, copies=False) Iterate the `points` starting at index `loop` and yield each as a Point3Tuple`(x, y, ll)`. |
Inherited from `_BaseIter`: `__iter__`, `__len__`, `next_` Inherited from `named._Named`: `__format__`, `__imatmul__`, `__matmul__`, `__repr__`, `__rmatmul__`, `__str__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `renamed`, `toRepr`, `toStr`, `toStr2` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `_BaseIter`: `copies`, `dedup`, `loop`, `looped`, `next` Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4`, `sizeof` Inherited from `object`: `__class__`

Method Details

### __init__ (self, points, loop=0, base=None, wrap=True, radius=None, dedup=False, **name) (Constructor) |
New LatLon2PsxyIter iterator. Arguments: `points` - `Iterable` or `list`, `sequence`, `set`, `tuple`, etc. (`LatLon`[]). `loop` - Number of loop-back points, also initial `enumerate` and `iterate` index (non-negative `int`). `base` - Optional `points` instance for type checking (`any`). `wrap` - If `True`, wrap or normalize the enum-/iterated `points` (`bool`). `radius` - Mean earth radius (`meter`) for conversion from `degrees` to `meter` (or `radians` if `radius=1`). `dedup` - Skip duplicate points (`bool`). `name` - Optional `name="latlon"` (`str`). Raises: `PointsError` - Insufficient number of `points`. `TypeError` - Some `points` are not `base`-compatible. Overrides: object.__init__ Note: The `LatLon` latitude is considered the pseudo-y and longitude the pseudo-x coordinate, like LatLon2psxy.

### __getitem__ (self, index) (Indexing operator) |
Get the point(s) at the given `index` or `slice`. Raises: `IndexError` - Invalid `index`, beyond `loop`. Overrides: _BaseIter.__getitem__

### enumerate (self, closed=False, copies=False) |
Iterate and yield each point as a 2-tuple `(index, Point3Tuple)`. Arguments: `closed` - Loop back to the first `point(s)`, de-dup'ed (`bool`). `copies` - Save a copy of all `points` (`bool`). Raises: `PointsError` - Insufficient number of `points` or using `closed=True` without `loop`-back. `TypeError` - Some `points` are not `base`-compatible. Overrides: _BaseIter.enumerate

### iterate (self, closed=False, copies=False) |
Iterate the `points` starting at index `loop` and yield each as a Point3Tuple`(x, y, ll)`. Arguments: `closed` - Loop back to the first `point(s)`, de-dup'ed (`bool`). `copies` - Save a copy of all `points` (`bool`). Raises: `PointsError` - Insufficient number of `points` or using `closed=True` without `loop`-back. `TypeError` - Some `points` are not `base`-compatible. Overrides: _BaseIter.iterate