Class: QgsMultiPolygon

Multi polygon geometry collection.

List of all members, including inherited members

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.

Constructor

__init__

Abstract Methods

clone

createEmptyWithSameType

simplifyByDistance

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)

abstract clone(self) → QgsMultiPolygon | None[source]
Return type:

QgsMultiPolygon|None

abstract createEmptyWithSameType(self) → QgsMultiPolygon | None[source]
Return type:

QgsMultiPolygon|None

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 simplifyByDistance(self, tolerance: float) → QgsMultiPolygon | None[source]
Parameters:

tolerance (float)

Return type:

QgsMultiPolygon|None

abstract toCurveType(self) → QgsMultiSurface | None[source]

Returns the geometry converted to the more generic curve type QgsMultiSurface

Return type:

QgsMultiSurface|None

Returns:

the converted geometry. Caller takes ownership