Class: QgsRasterMatrix

Represents a matrix in a raster calculator operation.

class qgis.analysis.QgsRasterMatrix[source]

Bases: object

class OneArgOperator

Bases: int

class TwoArgOperator

Bases: int

absoluteValue(self) bool[source]

Calculates the absolute value

Return type:

bool

Returns:

True on success

Added in version 3.10.

acosinus(self) bool[source]
Return type:

bool

add(self, other: QgsRasterMatrix) bool[source]

Adds another matrix to this one

Parameters:

other (QgsRasterMatrix)

Return type:

bool

asinus(self) bool[source]
Return type:

bool

atangens(self) bool[source]
Return type:

bool

changeSign(self) bool[source]
Return type:

bool

cosinus(self) bool[source]
Return type:

bool

divide(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

equal(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

greaterEqual(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

greaterThan(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

isNumber(self) bool[source]

Returns True if matrix is 1x1 (=scalar number)

Return type:

bool

lesserEqual(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

lesserThan(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

log(self) bool[source]
Return type:

bool

log10(self) bool[source]
Return type:

bool

logicalAnd(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

logicalOr(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

max(self, other: QgsRasterMatrix) bool[source]

Calculates the maximum value between two matrices

Return type:

bool

Returns:

True on success

Added in version 3.10.

Parameters:

other (QgsRasterMatrix)

min(self, other: QgsRasterMatrix) bool[source]

Calculates the minimum value between two matrices

Return type:

bool

Returns:

True on success

Added in version 3.10.

Parameters:

other (QgsRasterMatrix)

multiply(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

nColumns(self) int[source]
Return type:

int

nRows(self) int[source]
Return type:

int

nodataValue(self) float[source]
Return type:

float

notEqual(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

number(self) float[source]
Return type:

float

opABS = 10
opACOS = 5
opAND = 11
opASIN = 4
opATAN = 6
opCOS = 2
opDIV = 3
opEQ = 5
opGE = 9
opGT = 7
opLE = 10
opLOG = 8
opLOG10 = 9
opLT = 8
opMAX = 14
opMIN = 13
opMINUS = 1
opMUL = 2
opNE = 6
opOR = 12
opPLUS = 0
opPOW = 4
opSIGN = 7
opSIN = 1
opSQRT = 0
opTAN = 3
power(self, other: QgsRasterMatrix) bool[source]
Parameters:

other (QgsRasterMatrix)

Return type:

bool

setData(self, cols: int, rows: int, nodataValue: float) float | None[source]
Parameters:
  • cols (int)

  • rows (int)

  • nodataValue (float)

Return type:

Optional[float]

setNodataValue(self, d: float)[source]
Parameters:

d (float)

sinus(self) bool[source]
Return type:

bool

squareRoot(self) bool[source]
Return type:

bool

subtract(self, other: QgsRasterMatrix) bool[source]

Subtracts another matrix from this one

Parameters:

other (QgsRasterMatrix)

Return type:

bool

tangens(self) bool[source]
Return type:

bool