Class: QgsDatumTransform

Contains methods and classes relating the datum transformations.

class qgis.core.QgsDatumTransform[source]

Bases: object

class GridDetails

Bases: object

Contains information about a projection transformation grid file.

Added in version 3.8.

directDownload
fullName
isAvailable
openLicense
packageName
shortName
url
class SingleOperationDetails

Bases: object

Contains information about a single coordinate operation.

Note

Only used in builds based on on Proj >= 6.2

Added in version 3.10.

areaOfUse
authority
code
remarks
scope
class TransformDetails

Bases: object

Contains information about a coordinate transformation operation.

Note

Only used in builds based on on Proj >= 6.0

Added in version 3.8.

accuracy
areaOfUse
authority
bounds
code
grids
isAvailable
name
operationDetails
proj
remarks
scope
class TransformInfo

Bases: object

Contains datum transform information.

Deprecated since version 3.40: Not used on builds based on Proj >= 6.0.

datumTransformId
deprecated
destinationCrsAuthId
destinationCrsDescription
epsgCode
preferred
remarks
scope
sourceCrsAuthId
sourceCrsDescription
class TransformPair

Bases: object

Contains datum transform information.

Deprecated since version 3.40: Not used for builds based on Proj >= 6.0.

destinationTransformId
sourceTransformId
static datumTransformInfo(datumTransformId: int) QgsDatumTransform.TransformInfo[source]

Returns detailed information about the specified datumTransformId. If datumTransformId was not a valid transform ID, a TransformInfo with TransformInfo.datumTransformId of -1 will be returned.

Deprecated since version 3.40: Not used for builds based on Proj >= 6.0.

Parameters:

datumTransformId (int)

Return type:

QgsDatumTransform.TransformInfo

static datumTransformToProj(datumTransformId: int) str[source]

Returns a proj string representing the specified datumTransformId datum transform ID.

Deprecated since version 3.40: Not used for builds based on Proj >= 6.0.

Parameters:

datumTransformId (int)

Return type:

str

static datumTransformations(source: QgsCoordinateReferenceSystem, destination: QgsCoordinateReferenceSystem) List[QgsDatumTransform.TransformPair]

Returns a list of datum transformations which are available for the given source and destination CRS.

Deprecated since version 3.40: Not used for builds based on Proj >= 6.0.

Parameters:
Return type:

List[QgsDatumTransform.TransformPair]

static operations(source: QgsCoordinateReferenceSystem, destination: QgsCoordinateReferenceSystem, includeSuperseded: bool = False) List[QgsDatumTransform.TransformDetails]

Returns a list of coordinate operations available for transforming coordinates from the source to destination CRS.

This list is sorted in order of preference, with the most preferable operation listed first.

Not all operations may be available for use. Check QgsDatumTransform.TransformDetails.isAvailable first. Operations may require grid shift files which are not available on the local install.

If includeSuperseded is True, superseded (but not deprecated) transforms will be included in the results. This requires Proj >= 6.2.

Note

Requires Proj 6.0 or later. Builds based on earlier Proj versions will always return an empty list, and the deprecated API from QgsDatumTransform must be used instead.

Added in version 3.8.

Parameters:
Return type:

List[QgsDatumTransform.TransformDetails]

static projStringToDatumTransformId(string: str | None) int[source]

Returns the datum transform ID corresponding to a specified proj string. Returns -1 if matching datum ID was not found.

Deprecated since version 3.40: Not used for builds based on Proj >= 6.0.

Parameters:

string (Optional[str])

Return type:

int