Class: QgsMeshContours

class qgis.analysis.QgsMeshContours

Bases: sip.wrapper

Exporter of contours lines or polygons from a mesh layer.

New in version 3.12.

QgsMeshContours(layer: QgsMeshLayer) Constructs the mesh contours exporter. Caches the native and triangular mesh from data provider

Parameters:

layer – mesh layer to be associated with this exporter

QgsMeshContours(QgsMeshContours)

Methods

exportLines

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

exportPolygons

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

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

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) QgsGeometry

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 (QgsFeedback = None) – optional feedback object for progress and cancellation support

Return type:

QgsGeometry

Returns:

MultiPolygon geometry containing contour polygons

Note

not thread safe