Class: QgsSurface¶
- class qgis.core.QgsSurface¶
Bases:
QgsAbstractGeometry
Surface geometry type.
Methods
- rtype:
QgsRectangle
Default calculator for the minimal bounding box for the geometry.
Returns number of child geometries (for geometries with child geometries) or child points (for geometries without child geometries - i.e. curve / point).
Returns pointer to child geometry (for geometries with child geometries - i.e. geom.
Returns point at index (for geometries without child geometries - i.e. curve / point).
Compares to an
other
geometry of the same class, and returns a integer for sorting of the two geometries.Returns whether the geometry has any child geometries (
False
for point / curve,True
otherwise)- param flags:
Updates the geometry type based on whether sub geometries contain z or m values.
Returns the sort index for the geometry, used in the
compareTo()
method to compare geometries of different types.Gets a polygon representation of this surface.
- boundingBox(self) QgsRectangle ¶
- Return type:
- 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: Qgis.GeometryValidityFlags | Qgis.GeometryValidityFlag = Qgis.GeometryValidityFlags()) Tuple[bool, str] ¶
- Parameters:
flags (Union[Qgis.GeometryValidityFlags) –
- Return type:
Tuple[bool, str]
- setZMTypeFromSubGeometry(self, subggeom: QgsAbstractGeometry, baseGeomType: Qgis.WkbType)¶
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: