Class: QgsSingleBandPseudoColorRenderer¶
- class qgis.core.QgsSingleBandPseudoColorRenderer(input: QgsRasterInterface, band: int = - 1, shader: QgsRasterShader = None)¶
Bases:
QgsRasterRenderer
Note: takes ownership of
QgsRasterShader
Raster renderer pipe for single band pseudocolor.
Methods
- param visitor
Returns the band used by the renderer
- param bandNo
- rtype
float
- rtype
float
QgsSingleBandPseudoColorRenderer
cannot be copied.- param elem
- param nodeLayer
Creates a color ramp shader
Fill in histogram defaults if not specified
Fill in statistics defaults if not specified
- rtype
List[Tuple[str, QColor]]
Returns the color for the renderer to use to represent nodata pixels.
Sets the band used by the renderer.
- param max
- param min
Takes ownership of the shader
Returns the raster shader
- param doc
- rtype
List[int]
- param doc
- accept(self, visitor: QgsStyleEntityVisitorInterface) → bool¶
- Parameters
visitor (QgsStyleEntityVisitorInterface) –
- Return type
bool
- band(self) → int¶
Returns the band used by the renderer
New in version 2.7.
- Return type
int
- 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
- classificationMax(self) → float¶
- Return type
float
- classificationMin(self) → float¶
- Return type
float
- clone(self) → QgsSingleBandPseudoColorRenderer¶
QgsSingleBandPseudoColorRenderer
cannot be copied. Useclone()
instead.- Return type
- constShader(self) → QgsRasterShader¶
Note
available in Python as constShader
- Return type
- create(elem: QDomElement, input: QgsRasterInterface) → QgsRasterRenderer¶
- Parameters
elem (QDomElement) –
input (QgsRasterInterface) –
- Return type
- createLegendNodes(self, nodeLayer: QgsLayerTreeLayer) → List[QgsLayerTreeModelLegendNode]¶
- Parameters
nodeLayer (QgsLayerTreeLayer) –
- Return type
- createShader(self, colorRamp: QgsColorRamp = None, colorRampType: QgsColorRampShader.Type = QgsColorRampShader.Interpolated, classificationMode: QgsColorRampShader.ClassificationMode = QgsColorRampShader.Continuous, classes: int = 0, clip: bool = False, extent: QgsRectangle = QgsRectangle())¶
Creates a color ramp shader
- Parameters
colorRamp (
QgsColorRamp
= None) – vector color ramp. Ownership is transferred to the shader.colorRampType (QgsColorRampShader.Type = QgsColorRampShader.Interpolated) – type of color ramp shader
classificationMode (QgsColorRampShader.ClassificationMode = QgsColorRampShader.Continuous) – classification mode
classes (int = 0) – number of classes
clip (bool = False) – clip out of range values
extent (
QgsRectangle
= QgsRectangle()) – extent used in classification (only used in quantile mode)
- 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
- legendSymbologyItems(self) → List[Tuple[str, QColor]]¶
- Return type
List[Tuple[str, QColor]]
- 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.
- setBand(self, bandNo: int)¶
Sets the band used by the renderer.
See also
New in version 2.10.
- Parameters
bandNo (int) –
- setClassificationMax(self, max: float)¶
- Parameters
max (float) –
- setClassificationMin(self, min: float)¶
- Parameters
min (float) –
- setShader(self, shader: QgsRasterShader)¶
Takes ownership of the shader
- Parameters
shader (QgsRasterShader) –
- shader(self) → QgsRasterShader¶
Returns the raster shader
- Return type
- toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any] = {})¶
- Parameters
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –
- usesBands(self) → List[int]¶
- Return type
List[int]
- writeXml(self, doc: QDomDocument, parentElem: QDomElement)¶
- Parameters
doc (QDomDocument) –
parentElem (QDomElement) –