pyinterp.geometry.geographic.MultiPolygon

Contents

pyinterp.geometry.geographic.MultiPolygon#

class pyinterp.geometry.geographic.MultiPolygon(self, polygons: collections.abc.Sequence[pyinterp.core.geometry.geographic.Polygon] | None = None)#

Bases: object

A collection of polygons in geographic coordinates.

Behaves like a Python container of Polygon objects.

Construct a multipolygon from an optional sequence of polygons.

Parameters:

polygons – Optional sequence of Polygon objects.

Attributes

polygons

View over polygons bound to multipolygon lifetime.

Public Methods

append(self, poly)

Append a polygon to the collection.

clear(self)

Remove all polygons from the collection.

Special Methods

__bool__(self)

Return True if not empty.

__eq__(self, other)

Check if two multipolygons are equal.

__getitem__(self, arg, /)

Get polygon at index.

__getstate__(self)

Return the serialized state for pickling.

__iter__(self)

Iterate over polygons.

__len__(self)

Number of polygons.

__ne__(self, other)

Check if two multipolygons are not equal.

__new__(*args, **kwargs)

__repr__(self)

Return the official string representation of the multipolygon.

__setitem__(self, idx, poly)

Set polygon at index.

__setstate__(self, state)

Restore the multipolygon from the serialized state.

__str__(self)

Return the string representation of the multipolygon.