Class: QgsRasterMatrix

class qgis.analysis.QgsRasterMatrix

Bases: sip.wrapper

Represents a matrix in a raster calculator operation.

QgsRasterMatrix() Takes ownership of data array

QgsRasterMatrix(m: QgsRasterMatrix)

Methods

absoluteValue

Calculates the absolute value

acosinus

rtype:

bool

add

Adds another matrix to this one

asinus

rtype:

bool

atangens

rtype:

bool

changeSign

rtype:

bool

cosinus

rtype:

bool

divide

param other:

equal

param other:

greaterEqual

param other:

greaterThan

param other:

isNumber

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

lesserEqual

param other:

lesserThan

param other:

log

rtype:

bool

log10

rtype:

bool

logicalAnd

param other:

logicalOr

param other:

max

Calculates the maximum value between two matrices

min

Calculates the minimum value between two matrices

multiply

param other:

nColumns

rtype:

int

nRows

rtype:

int

nodataValue

rtype:

float

notEqual

param other:

number

rtype:

float

power

param other:

setData

param cols:

setNodataValue

param d:

sinus

rtype:

bool

squareRoot

rtype:

bool

subtract

Subtracts another matrix from this one

tangens

rtype:

bool

Attributes

opABS

opACOS

opAND

opASIN

opATAN

opCOS

opDIV

opEQ

opGE

opGT

opLE

opLOG

opLOG10

opLT

opMAX

opMIN

opMINUS

opMUL

opNE

opOR

opPLUS

opPOW

opSIGN

opSIN

opSQRT

opTAN

class OneArgOperator

Bases: int

class TwoArgOperator

Bases: int

absoluteValue(self) bool

Calculates the absolute value

Return type:

bool

Returns:

True on success

Added in version 3.10.

acosinus(self) bool
Return type:

bool

add(self, other: QgsRasterMatrix) bool

Adds another matrix to this one

Parameters:

other (QgsRasterMatrix)

Return type:

bool

asinus(self) bool
Return type:

bool

atangens(self) bool
Return type:

bool

changeSign(self) bool
Return type:

bool

cosinus(self) bool
Return type:

bool

divide(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

equal(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

greaterEqual(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

greaterThan(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

isNumber(self) bool

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

Return type:

bool

lesserEqual(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

lesserThan(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

log(self) bool
Return type:

bool

log10(self) bool
Return type:

bool

logicalAnd(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

logicalOr(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

max(self, other: QgsRasterMatrix) bool

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

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
Parameters:

other (QgsRasterMatrix)

Return type:

bool

nColumns(self) int
Return type:

int

nRows(self) int
Return type:

int

nodataValue(self) float
Return type:

float

notEqual(self, other: QgsRasterMatrix) bool
Parameters:

other (QgsRasterMatrix)

Return type:

bool

number(self) float
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
Parameters:

other (QgsRasterMatrix)

Return type:

bool

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

  • rows (int)

  • nodataValue (float)

Return type:

Optional[float]

setNodataValue(self, d: float)
Parameters:

d (float)

sinus(self) bool
Return type:

bool

squareRoot(self) bool
Return type:

bool

subtract(self, other: QgsRasterMatrix) bool

Subtracts another matrix from this one

Parameters:

other (QgsRasterMatrix)

Return type:

bool

tangens(self) bool
Return type:

bool