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

# Module iters

Iterators with options.

Iterator classes LatLon2PsxyIter and PointsIter to iterate over iterables, lists, sets, tuples, etc. with optional loop-back to the initial items, skipping of duplicate items and copying of the iterated items.

Version: 21.09.26

Classes
| _BaseIter (INTERNAL) Iterator over items with loop-back and de-duplication.
| PointsIter Iterator for `points` with optional loop-back and copies.
| LatLon2PsxyIter Iterate and convert for `points` with optional loop-back and copies.

Functions
isNumpy2(obj) Check for an `Numpy2LatLon` points wrapper. |
isPoints2(obj) Check for an `LatLon2psxy` points wrapper. |
isTuple2(obj) Check for an `Tuple2LatLon` points wrapper. |
iterNumpy2(obj) Iterate over Numpy2 wrappers or other sequences exceeding the threshold. |
iterNumpy2over(n=None) Get or set the iterNumpy2 threshold. |
points2(points, closed=True, base=None, Error=<class 'pygeodesy.errors.PointsError'>) Check a path or polygon represented by points. |

Variables
| __all__ = `_ALL_LAZY.iters`

Function Details

### isNumpy2 (obj) |
Check for an `Numpy2LatLon` points wrapper. Arguments: `obj` - The object (any `type`). Returns: `True` if `obj` is an `Numpy2LatLon` instance, `False` otherwise.

### isPoints2 (obj) |
Check for an `LatLon2psxy` points wrapper. Arguments: `obj` - The object (any `type`). Returns: `True` if `obj` is an `LatLon2psxy` instance, `False` otherwise.

### isTuple2 (obj) |
Check for an `Tuple2LatLon` points wrapper. Arguments: `obj` - The object (any). Returns: `True` if `obj` is an `Tuple2LatLon` instance, `False` otherwise.

### iterNumpy2 (obj) |
Iterate over Numpy2 wrappers or other sequences exceeding the threshold. Arguments: `obj` - Points array, list, sequence, set, etc. (any). Returns: `True` do, `False` don't iterate.

### iterNumpy2over (n=None) |
Get or set the iterNumpy2 threshold. Arguments: `n` - Optional, new threshold (`int`). Returns: Previous threshold (`int`). Raises: `ValueError` - Invalid `n`.

### points2 (points, closed=True, base=None, Error=<class 'pygeodesy.errors.PointsError'>) |
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. `Error` - Exception to raise (`ValueError`). 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` compatible.