Class: QgsRasterContourRenderer

class qgis.core.QgsRasterContourRenderer(input: QgsRasterInterface)

Bases: QgsRasterRenderer

Creates a contour renderer

Raster renderer that generates contours on the fly for a source raster band.

New in version 3.14.

Parameters

input

block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None)QgsRasterBlock
Parameters
Return type

QgsRasterBlock

clone(self)QgsRasterContourRenderer

QgsRasterContourRenderer cannot be copied. Use clone() instead.

Return type

QgsRasterContourRenderer

contourIndexInterval(self) → float

Returns the interval of index contour lines (index contour lines are typical further apart and with a wider line symbol)

Return type

float

contourIndexSymbol(self)QgsLineSymbol

Returns the symbol of index contour lines

Return type

QgsLineSymbol

contourInterval(self) → float

Returns the interval of contour lines generation

Return type

float

contourSymbol(self)QgsLineSymbol

Returns the symbol used for contour lines

Return type

QgsLineSymbol

create(elem: QDomElement, input: QgsRasterInterface)QgsRasterRenderer

Creates an instance of the renderer based on definition from XML (used by renderer registry)

Parameters
Return type

QgsRasterRenderer

downscale(self) → float

Returns by how much the renderer will scale down the request to the data provider. For example, for a raster block 1000x500 with downscale 10, the renderer will request raster 100x50 from provider. Higher downscale makes contour lines more simplified (at the expense of losing some detail). The value of one means there will be no downscaling.

Return type

float

initHistogram()
initStatistics()
inputBand(self) → int

Returns the number of the input raster band

Return type

int

renderColorForNodataPixel()
setContourIndexInterval(self, interval: float)

Sets the interval of index contour lines (index contour lines are typical further apart and with a wider line symbol)

Parameters

interval (float) –

setContourIndexSymbol(self, symbol: QgsLineSymbol)

Sets the symbol of index contour lines

Parameters

symbol (QgsLineSymbol) –

setContourInterval(self, interval: float)

Sets the interval of contour lines generation

Parameters

interval (float) –

setContourSymbol(self, symbol: QgsLineSymbol)

Sets the symbol used for contour lines. Takes ownership of the passed symbol

Parameters

symbol (QgsLineSymbol) –

setDownscale(self, scale: float)

Sets by how much the renderer will scale down the request to the data provider.

See also

downscale()

Parameters

scale (float) –

setInputBand(self, band: int)

Sets the number of the input raster band

Parameters

band (int) –

usesBands(self) → List[int]
Return type

List[int]

writeXml(self, doc: QDomDocument, parentElem: QDomElement)
Parameters
  • doc (QDomDocument) –

  • parentElem (QDomElement) –