Class: QgsRasterCalcNode

class qgis.analysis.QgsRasterCalcNode

Bases: sip.wrapper

Represents a node in a raster calculator.

QgsRasterCalcNode() Constructor for QgsRasterCalcNode.

QgsRasterCalcNode(number: float)

QgsRasterCalcNode(matrix: QgsRasterMatrix)

QgsRasterCalcNode(op: QgsRasterCalcNode.Operator, left: QgsRasterCalcNode, right: QgsRasterCalcNode)

QgsRasterCalcNode(functionName: str, functionArgs: Iterable[QgsRasterCalcNode]) Constructor for the tFunction type

QgsRasterCalcNode(rasterName: str)

Methods

cleanRasterReferences

Returns a list of raster layer references that are addressed in the formula, without quotation marks.

findNodes

Returns a list of nodes of a specific type

parseRasterCalcString

param str

referencedLayerNames

Returns a list of raster layer names that are referenced in the formula without the quotation marks.

setLeft

param left

setRight

param right

toString

Returns a string representation of the expression

type

QgsRasterCalcNode cannot be copied

Attributes

opABS

opACOS

opAND

opASIN

opATAN

opCOS

opDIV

opEQ

opGE

opGT

opLE

opLOG

opLOG10

opLT

opMAX

opMIN

opMINUS

opMUL

opNE

opNONE

opOR

opPLUS

opPOW

opSIGN

opSIN

opSQRT

opTAN

tFunction

tMatrix

tNumber

tOperator

tRasterRef

class Operator

Bases: int

class Type

Bases: int

cleanRasterReferences(self) List[str]

Returns a list of raster layer references that are addressed in the formula, without quotation marks.

Note

since QGIS 3.22

Return type

List[str]

findNodes(self, type: QgsRasterCalcNode.Type) List[QgsRasterCalcNode]

Returns a list of nodes of a specific type

New in version 3.6.

Parameters

type (QgsRasterCalcNode.Type) –

Return type

List[QgsRasterCalcNode]

opABS = 23
opACOS = 10
opAND = 18
opASIN = 9
opATAN = 11
opCOS = 7
opDIV = 3
opEQ = 12
opGE = 16
opGT = 14
opLE = 17
opLOG = 21
opLOG10 = 22
opLT = 15
opMAX = 24
opMIN = 25
opMINUS = 1
opMUL = 2
opNE = 13
opNONE = 26
opOR = 19
opPLUS = 0
opPOW = 4
opSIGN = 20
opSIN = 6
opSQRT = 5
opTAN = 8
parseRasterCalcString(str: str, parserErrorMsg: str) QgsRasterCalcNode
Parameters
  • str (str) –

  • parserErrorMsg (str) –

Return type

QgsRasterCalcNode

referencedLayerNames(self) List[str]

Returns a list of raster layer names that are referenced in the formula without the quotation marks. It uses QgsRasterCalcNode.cleanRasterReferences

Note

since QGIS 3.22

Return type

List[str]

setLeft(self, left: QgsRasterCalcNode)
Parameters

left (QgsRasterCalcNode) –

setRight(self, right: QgsRasterCalcNode)
Parameters

right (QgsRasterCalcNode) –

tFunction = 5
tMatrix = 4
tNumber = 2
tOperator = 1
tRasterRef = 3
toString(self, cStyle: bool = False) str

Returns a string representation of the expression

Parameters

cStyle (bool = False) – if True operators will follow C syntax

New in version 3.6.

Return type

str

type(self) QgsRasterCalcNode.Type

QgsRasterCalcNode cannot be copied

Return type

QgsRasterCalcNode.Type