Subgroup: other

Class: QgsPalettedRasterRenderer

class qgis.core.QgsPalettedRasterRenderer

Bases: qgis._core.QgsRasterRenderer

Renderer for paletted raster images.

Methods

alphaBand
band Returns the raster band used for rendering the raster.
bandCount
bandStatistics Get band statistics.
block
capabilities Returns a bitmask containing the supported capabilities
capabilitiesString Returns the above in friendly format.
classDataFromFile Opens a color table file and returns corresponding paletted renderer class data.
classDataFromRaster Generates class data from a raster, for the specified bandNumber.
classDataFromString Converts a string containing a color table or class data to to paletted renderer class data.
classDataToString Converts classes to a string representation, using the .clr/gdal color table file format.
classes Returns a map of value to classes (colors) used by the renderer.
clone QgsPalettedRasterRenderer cannot be copied.
colorTableToClassData Converts a raster color table to paletted renderer class data.
copyCommonProperties Copies common properties like opacity / transparency data from other renderer.
create
cumulativeCut Find values for cumulative pixel count cut.
dataType
dataTypeSize
extent Get the extent of the interface.
generateBandName helper function to create zero padded band names
hasHistogram Returns true if histogram is available (cached, already calculated)
hasStatistics Returns true if histogram is available (cached, already calculated).
histogram Get histogram.
initHistogram
initStatistics
input Current input
label Return optional category label
legendSymbologyItems
minMaxOrigin Returns const reference to origin of min/max values
nColors Returns number of colors
on Is on/off
opacity Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1.0 (fully opaque).
rasterTransparency
readXml Sets base class members from xml.
setAlphaBand
setInput
setLabel Set category label
setMinMaxOrigin Sets origin of min/max values
setOn Set on/off
setOpacity Sets the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1.0 (fully opaque).
setRasterTransparency
setSourceColorRamp Set the source color ramp.
sourceColorRamp Get the source color ramp
sourceDataType Returns source data type for the band specified by number,
sourceInput Get source / raw input, the first in pipe, usually provider.
type
usesBands
usesTransparency
writeXml
xBlockSize Get block size
xSize Get raster size
yBlockSize
ySize

Attributes

BuildPyramids
Create
Identify
IdentifyFeature
IdentifyHtml
IdentifyText
IdentifyValue
NODATA_COLOR
NoCapabilities
Remove
Size
class Class(value: int, color: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), label: str = '')

Bases: sip.wrapper

Constructor for Class

QgsPalettedRasterRenderer.Class(QgsPalettedRasterRenderer.Class)

color
label
value
band(self) → int

Returns the raster band used for rendering the raster.

New in version 3.0.

block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None) → QgsRasterBlock
classDataFromFile(path: str) → object

Opens a color table file and returns corresponding paletted renderer class data.

New in version 3.0.

classDataFromRaster(raster: QgsRasterInterface, bandNumber: int, ramp: QgsColorRamp = None, feedback: QgsRasterBlockFeedback = None) → object

Generates class data from a raster, for the specified bandNumber. An optional color ramp can be specified to automatically assign colors from the ramp.

New in version 3.0.

classDataFromString(string: str) → object

Converts a string containing a color table or class data to to paletted renderer class data.

New in version 3.0.

classDataToString(classes: object) → str

Converts classes to a string representation, using the .clr/gdal color table file format.

New in version 3.0.

classes(self) → object

Returns a map of value to classes (colors) used by the renderer.

clone(self) → QgsPalettedRasterRenderer

QgsPalettedRasterRenderer cannot be copied. Use clone() instead.

colorTableToClassData(table: Iterable[QgsColorRampShader.ColorRampItem]) → object

Converts a raster color table to paletted renderer class data.

New in version 3.0.

create(elem: QDomElement, input: QgsRasterInterface) → QgsRasterRenderer
initHistogram()
initStatistics()
label(self, idx: int) → str

Return optional category label

New in version 2.1.

legendSymbologyItems(self) → List[Tuple[str, QColor]]
nColors(self) → int

Returns number of colors

setLabel(self, idx: int, label: str)

Set category label

New in version 2.1.

setSourceColorRamp(self, ramp: QgsColorRamp)

Set the source color ramp. Ownership is transferred to the renderer.

New in version 3.0.

sourceColorRamp(self) → QgsColorRamp

Get the source color ramp

New in version 3.0.

usesBands(self) → List[int]
writeXml(self, doc: QDomDocument, parentElem: QDomElement)