Class: QgsRasterProjector

Implements approximate projection support for optimised raster transformation.

QgsRasterProjector calculates a grid of points in the source CRS for a specific target CRS and extent. These are used to calculate affine transformation matrices, which can be used instead of raw PROJ transformations for optimised bulk reprojection of points.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRasterProjector

Base classes

QgsRasterInterface

Base class for processing filters like renderers, reprojector, resampler etc.

Methods

destExtentSize

Calculate destination extent and size from source extent and size

destinationCrs

Returns the destination CRS

precision

setCrs

Sets the source and destination CRS

setPrecision

sourceCrs

Returns the source CRS

Static Methods

extentSize

Calculate destination extent and size from source extent and size

precisionLabel

Attributes

Approximate

Exact

class qgis.core.QgsRasterProjector[source]

Bases: QgsRasterInterface

Approximate = 0
Exact = 1
class Precision

Bases: int

destExtentSize(self, srcExtent: QgsRectangle, srcXSize: int, srcYSize: int)[source]

Calculate destination extent and size from source extent and size

Parameters:
  • srcExtent (QgsRectangle)

  • srcXSize (int)

  • srcYSize (int) -> (bool)

destinationCrs(self) QgsCoordinateReferenceSystem[source]

Returns the destination CRS

Return type:

QgsCoordinateReferenceSystem

static extentSize(ct: QgsCoordinateTransform, srcExtent: QgsRectangle, srcXSize: int, srcYSize: int)[source]

Calculate destination extent and size from source extent and size

Parameters:
precision(self) QgsRasterProjector.Precision[source]
Return type:

QgsRasterProjector.Precision

static precisionLabel(precision: QgsRasterProjector.Precision) str[source]
Parameters:

precision (QgsRasterProjector.Precision)

Return type:

str

setCrs(self, srcCRS: QgsCoordinateReferenceSystem, destCRS: QgsCoordinateReferenceSystem, srcDatumTransform: int = -1, destDatumTransform: int = -1)[source]

Sets the source and destination CRS

Deprecated since version 3.8: Use transformContext version instead.

Parameters:
setCrs(self, srcCRS: QgsCoordinateReferenceSystem, destCRS: QgsCoordinateReferenceSystem, transformContext: QgsCoordinateTransformContext)[source]

Sets source CRS to srcCRS and destination CRS to destCRS and the transformation context to transformContext

Added in version 3.8.

Parameters:
setPrecision(self, precision: QgsRasterProjector.Precision)[source]
Parameters:

precision (QgsRasterProjector.Precision)

sourceCrs(self) QgsCoordinateReferenceSystem[source]

Returns the source CRS

Return type:

QgsCoordinateReferenceSystem