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:
Methods
- param bandNo
QgsRasterContourRenderer
cannot be copied.Returns the interval of index contour lines (index contour lines are typical further apart and with a wider line symbol)
Returns the symbol of index contour lines
Returns the interval of contour lines generation
Returns the symbol used for contour lines
Creates an instance of the renderer based on definition from XML (used by renderer registry)
Returns by how much the renderer will scale down the request to the data provider.
Fill in histogram defaults if not specified
Fill in statistics defaults if not specified
Returns the number of the input raster band
Returns the color for the renderer to use to represent nodata pixels.
Sets the interval of index contour lines (index contour lines are typical further apart and with a wider line symbol)
Sets the symbol of index contour lines
Sets the interval of contour lines generation
Sets the symbol used for contour lines.
Sets by how much the renderer will scale down the request to the data provider.
Sets the number of the input raster band
- rtype
List[int]
- param doc
- block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None) QgsRasterBlock ¶
- Parameters
bandNo (int) –
extent (QgsRectangle) –
width (int) –
height (int) –
feedback (
QgsRasterBlockFeedback
= None) –
- Return type
- clone(self) QgsRasterContourRenderer ¶
QgsRasterContourRenderer
cannot be copied. Useclone()
instead.- Return type
- 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
- 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
- create(elem: QDomElement, input: QgsRasterInterface) QgsRasterRenderer ¶
Creates an instance of the renderer based on definition from XML (used by renderer registry)
- Parameters
elem (QDomElement) –
input (QgsRasterInterface) –
- Return type
- 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(self, histogram: QgsRasterHistogram, bandNo: int, binCount: int, minimum: object = Py_None, maximum: object = Py_None, boundingBox: QgsRectangle = QgsRectangle(), sampleSize: int = 0, includeOutOfRange: bool = False)¶
Fill in histogram defaults if not specified
Note
the parameters are the same as in
histogram()
- initStatistics(self, statistics: QgsRasterBandStats, bandNo: int, stats: int = QgsRasterBandStats.All, boundingBox: QgsRectangle = QgsRectangle(), binCount: int = 0)¶
Fill in statistics defaults if not specified
- inputBand(self) int ¶
Returns the number of the input raster band
- Return type
int
- renderColorForNodataPixel(self) int ¶
Returns the color for the renderer to use to represent nodata pixels.
Subclasses should use this rather then
nodataColor()
to determine the color to use for nodata pixels during an actual rendering operation.New in version 3.10.
- 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
- 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) –