Class: QgsSurface

class qgis.core.QgsSurface

Bases: QgsAbstractGeometry

Surface geometry type.

Methods

boundingBox

rtype

QgsRectangle

calculateBoundingBox

Default calculator for the minimal bounding box for the geometry.

childCount

Returns number of child geometries (for geometries with child geometries) or child points (for geometries without child geometries - i.e. curve / point).

childGeometry

Returns pointer to child geometry (for geometries with child geometries - i.e. geom.

childPoint

Returns point at index (for geometries without child geometries - i.e. curve / point).

clearCache

compareToSameClass

Compares to an other geometry of the same class, and returns a integer for sorting of the two geometries.

hasChildGeometries

Returns whether the geometry has any child geometries (False for point / curve, True otherwise)

isValid

param flags

setZMTypeFromSubGeometry

Updates the geometry type based on whether sub geometries contain z or m values.

sortIndex

Returns the sort index for the geometry, used in the compareTo() method to compare geometries of different types.

surfaceToPolygon

Gets a polygon representation of this surface.

boundingBox(self) QgsRectangle
Return type

QgsRectangle

calculateBoundingBox(self) QgsRectangle

Default calculator for the minimal bounding box for the geometry. Derived classes should override this method if a more efficient bounding box calculation is available.

childCount(self) int

Returns number of child geometries (for geometries with child geometries) or child points (for geometries without child geometries - i.e. curve / point)

Note

used for vertex_iterator implementation

New in version 3.0.

childGeometry(self, index: int) QgsAbstractGeometry

Returns pointer to child geometry (for geometries with child geometries - i.e. geom. collection / polygon)

Note

used for vertex_iterator implementation

New in version 3.0.

childPoint(self, index: int) QgsPoint

Returns point at index (for geometries without child geometries - i.e. curve / point)

Note

used for vertex_iterator implementation

New in version 3.0.

clearCache(self)
compareToSameClass(self, other: QgsAbstractGeometry) int

Compares to an other geometry of the same class, and returns a integer for sorting of the two geometries.

Note

The actual logic for the sorting is an internal detail only and is subject to change between QGIS versions. The result should only be used for direct comparison of geometries and not stored for later use.

New in version 3.20.

hasChildGeometries(self) bool

Returns whether the geometry has any child geometries (False for point / curve, True otherwise)

Note

used for vertex_iterator implementation

New in version 3.0.

isValid(self, flags: Union[Qgis.GeometryValidityFlags, Qgis.GeometryValidityFlag] = Qgis.GeometryValidityFlags()) Tuple[bool, str]
Parameters

flags (Union[Qgis.GeometryValidityFlags) –

Return type

Tuple[bool, str]

setZMTypeFromSubGeometry(self, subggeom: QgsAbstractGeometry, baseGeomType: QgsWkbTypes.Type)

Updates the geometry type based on whether sub geometries contain z or m values.

sortIndex(self) int

Returns the sort index for the geometry, used in the compareTo() method to compare geometries of different types.

New in version 3.20.

surfaceToPolygon(self) QgsPolygon

Gets a polygon representation of this surface. Ownership is transferred to the caller.

Return type

QgsPolygon