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

# Class PointsIter

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

Known Subclasses:
  - LatLon2PsxyIter

Iterator for `points` with optional loop-back and copies.

Instance Methods
__init__(self, points, loop=0, base=None, dedup=False, name='') New PointsIter iterator. |
enumerate(self, closed=False, copies=False) Iterate and yield each point as a 2-tuple `(index, point)`. |
iterate(self, closed=False, copies=False) Iterate through all `points` starting at index `loop`. |
Inherited from `_BaseIter`: `__getitem__`, `__iter__`, `__len__`, `next_` Inherited from `named._Named`: `_DOT_`, `__imatmul__`, `__matmul__`, `__repr__`, `__rmatmul__`, `__str__`, `attrs`, `classof`, `copy`, `dup`, `rename`, `toRepr`, `toStr`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

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

Method Details

### __init__ (self, points, loop=0, base=None, dedup=False, name='') (Constructor) |
New PointsIter iterator. Arguments: `points` - `Iterable` or `list`, `sequence`, `set`, `tuple`, etc. (`point`s). `loop` - Number of loop-back points, also initial `enumerate` and `iterate` index (non-negative `int`). `base` - Optional `points` instance for type checking (`any`). `dedup` - Skip duplicate points (`bool`). `name` - Optional name (`str`). Raises: `PointsError` - Insufficient number of `points`. `TypeError` - Some `points` are not `base`. Overrides: object.__init__

### enumerate (self, closed=False, copies=False) |
Iterate and yield each point as a 2-tuple `(index, point)`. Arguments: `closed` - Look 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 through all `points` starting at index `loop`. Arguments: `closed` - Look 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