Class: QgsPolyhedralSurface¶
Polyhedral surface geometry type.
A polyhedral surface is a collection of polygons which share common boundary segments.
Added in version 3.40.
Class Hierarchy¶
Base classes¶
Surface geometry type. |
|
Abstract base class for all geometries. |
Subclasses¶
Triangulated surface geometry type. |
Abstract Methods
Returns approximate rotation angle for a vertex. |
Methods
Returns the number of patches contained with the polyhedral surface. |
|
Retrieves a patch from the polyhedral surface. |
|
Removes a patch from the polyhedral surface. |
|
Converts a polyhedral surface to a multipolygon. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsPolyhedralSurface. See the FAQ for more details.
Adds a patch to the geometry, transferring ownership to the polyhedral surface. |
|
Returns a geometry without curves. |
|
Sets all patches, transferring ownership to the polyhedral surface. |
- class qgis.core.QgsPolyhedralSurface[source]¶
Bases:
QgsSurface
- __init__()
- __init__(p: QgsPolyhedralSurface)
- Parameters:
- __init__(multiPolygon: QgsMultiPolygon | None)
Creates a polyhedral surface from a multiPolygon.
- Parameters:
multiPolygon (Optional[QgsMultiPolygon])
- virtual addPatch(self, patch: QgsPolygon | None)[source]¶
Adds a patch to the geometry, transferring ownership to the polyhedral surface.
- Parameters:
patch (Optional[QgsPolygon])
- numPatches(self) int [source]¶
Returns the number of patches contained with the polyhedral surface.
See also
- Return type:
int
- patchN(self, i: int) QgsPolygon [source]¶
Retrieves a patch from the polyhedral surface. The first patch has index 0.
- Raises:
IndexError – if no patch with the specified index exists.
See also
- Parameters:
i (int)
- Return type:
- removePatch(self, ringIndex: int) bool [source]¶
Removes a patch from the polyhedral surface. The first patch has index 0. The corresponding patch is removed from the polyhedral surface and deleted.
- Raises:
IndexError – if no patch with the specified index exists.
- Parameters:
ringIndex (int)
- Return type:
bool
- virtual segmentize(self, tolerance: float = M_PI_2 / 90, toleranceType: QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) QgsAbstractGeometry | None [source]¶
Returns a geometry without curves. Caller takes ownership
- Parameters:
tolerance (float = M_PI_2/90) – segmentation tolerance
toleranceType (QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) – maximum segmentation angle or maximum difference between approximation and curve
- Return type:
Optional[QgsAbstractGeometry]
- virtual setPatches(self, patches: Iterable[QgsPolygon])[source]¶
Sets all patches, transferring ownership to the polyhedral surface.
- Parameters:
patches (Iterable[QgsPolygon])
- toMultiPolygon(self) QgsMultiPolygon | None [source]¶
Converts a polyhedral surface to a multipolygon. Caller takes ownership.
- Return type:
Optional[QgsMultiPolygon]
- abstract vertexAngle(self, vertex: QgsVertexId) float [source]¶
Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
- Parameters:
vertex (QgsVertexId) – the vertex id
- Return type:
float
- Returns:
rotation in radians, clockwise from north