Class: QgsMultiPolygon

Multi polygon geometry collection.

Class Hierarchy

Inheritance diagram of qgis.core.QgsMultiPolygon

Base classes

QgsMultiSurface

Multi surface geometry collection.

QgsGeometryCollection

Geometry collection.

QgsAbstractGeometry

Abstract base class for all geometries.

Abstract Methods

toCurveType

Returns the geometry converted to the more generic curve type QgsMultiSurface

Methods

polygonN

Returns the polygon with the specified index.

class qgis.core.QgsMultiPolygon[source]

Bases: QgsMultiSurface

__init__()

Constructor for an empty multipolygon geometry.

__init__(polygons: Iterable[QgsPolygon])

Constructor for a multipolygon containing the specified polygons.

The polygons will be internally cloned.

Added in version 3.38.

Parameters:

polygons (Iterable[QgsPolygon])

__init__(polygons: Iterable[QgsPolygon])

Constructor for a multipolygon containing the specified polygons.

Ownership of the polygons will be transferred to the multipolygon.

Added in version 3.38.

Parameters:

polygons (Iterable[QgsPolygon])

__init__(a0: QgsMultiPolygon)
Parameters:

a0 (QgsMultiPolygon)

polygonN(self, index: int) QgsPolygon[source]

Returns the polygon with the specified index.

Raises:

IndexError – if no polygon with the specified index exists.

Added in version 3.16.

Parameters:

index (int)

Return type:

QgsPolygon

abstract toCurveType(self) QgsMultiSurface | None[source]

Returns the geometry converted to the more generic curve type QgsMultiSurface

Return type:

Optional[QgsMultiSurface]

Returns:

the converted geometry. Caller takes ownership