Class: QgsDatumTransform

class qgis.core.QgsDatumTransform

Bases: sip.wrapper

Contains methods and classes relating the datum transformations.

New in version 3.0:

Methods

datumTransformInfo

Returns detailed information about the specified datumTransformId.

datumTransformToProj

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

datumTransformations

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

operations

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

projStringToDatumTransformId

Returns the datum transform ID corresponding to a specified proj string.

class GridDetails
class GridDetails(QgsDatumTransform.GridDetails) None

Bases: sip.wrapper

directDownload
fullName
isAvailable
openLicense
packageName
shortName
url
class SingleOperationDetails
class SingleOperationDetails(QgsDatumTransform.SingleOperationDetails) None

Bases: sip.wrapper

areaOfUse
authority
code
remarks
scope
class TransformDetails
class TransformDetails(QgsDatumTransform.TransformDetails) None

Bases: sip.wrapper

accuracy
areaOfUse
authority
bounds
code
grids
isAvailable
name
operationDetails
proj
remarks
scope
class TransformInfo
class TransformInfo(QgsDatumTransform.TransformInfo) None

Bases: sip.wrapper

datumTransformId
deprecated
destinationCrsAuthId
destinationCrsDescription
epsgCode
preferred
remarks
scope
sourceCrsAuthId
sourceCrsDescription
class TransformPair(sourceTransformId: int = - 1, destinationTransformId: int = - 1)

Bases: sip.wrapper

Constructor for a TransformPair with the specified sourceTransformId and destinationTransformId transforms.

QgsDatumTransform.TransformPair(QgsDatumTransform.TransformPair)

destinationTransformId
sourceTransformId
datumTransformInfo(datumTransformId: int) QgsDatumTransform.TransformInfo

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 Not: used for builds based on Proj >= 6.0

Parameters

datumTransformId (int) –

Return type

QgsDatumTransform.TransformInfo

datumTransformToProj(datumTransformId: int) str

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

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

Parameters

datumTransformId (int) –

Return type

str

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 Not: used for builds based on Proj >= 6.0

Parameters
Return type

List[QgsDatumTransform.TransformPair]

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.

New in version 3.8.

Parameters
Return type

List[QgsDatumTransform.TransformDetails]

projStringToDatumTransformId(string: str) int

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

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

Parameters

string (str) –

Return type

int