Class: QgsMeshContours

Exporter of contours lines or polygons from a mesh layer.

Added in version 3.12.

class qgis.analysis.QgsMeshContours[source]

Bases: object

__init__(layer: QgsMeshLayer | None)

Constructs the mesh contours exporter. Caches the native and triangular mesh from data provider

Parameters:

layer (Optional[QgsMeshLayer]) – mesh layer to be associated with this exporter

__init__(a0: QgsMeshContours)
Parameters:

a0 (QgsMeshContours)

exportLines(self, index: QgsMeshDatasetIndex, value: float, method: QgsMeshRendererScalarSettings.DataResamplingMethod, feedback: QgsFeedback | None = None) QgsGeometry[source]

Exports multi line string containing the contour line for particular dataset and value.

Parameters:
Return type:

QgsGeometry

Returns:

MultiLineString geometry containing contour lines

Note

not thread safe

exportPolygons(self, index: QgsMeshDatasetIndex, min_value: float, max_value: float, method: QgsMeshRendererScalarSettings.DataResamplingMethod, feedback: QgsFeedback | None = None) QgsGeometry[source]

Exports multi polygons representing the areas with values in range for particular dataset

Parameters:
  • index (QgsMeshDatasetIndex) – dataset index

  • min_value (float) – minimum of the value interval for contour polygon

  • max_value (float) – maximum of the value interval for contour polygon

  • method (QgsMeshRendererScalarSettings.DataResamplingMethod) – for datasets defined on faces, the method will be used to convert data to vertices

  • feedback (Optional[QgsFeedback] = None) – optional feedback object for progress and cancellation support

Return type:

QgsGeometry

Returns:

MultiPolygon geometry containing contour polygons

Note

not thread safe