Class: QgsDatumTransform

Contains methods and classes relating the datum transformations.

Static 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 qgis.core.QgsDatumTransform[source]

Bases: object

class GridDetails

Bases: object

Contains information about a projection transformation grid file.

Added in version 3.8.

directDownload

True if direct download of grid is possible

fullName

Full name of transform grid

isAvailable

True if grid is currently available for use

openLicense

True if grid is available under an open license

packageName

Name of package the grid is included within

shortName

Short name of transform grid

url

Url to download grid from

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

Area of use, from EPSG registry database

authority

Authority name, e.g. EPSG.

code

Authority code, e.g. “8447” (for EPSG:8447).

remarks

Remarks for operation, from EPSG registry database

scope

Scope of operation, from EPSG registry database

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

Transformation accuracy (in meters)

areaOfUse

Area of use string.

This is only available for single step coordinate operations. For multi-step operations, check operationDetails instead.

See also

bounds()

authority

Authority name, e.g. EPSG.

This is only available for single step coordinate operations. For multi-step operations, check operationDetails instead.

bounds

Valid bounds for the coordinate operation.

See also

areaOfUse()

code

Identification code, e.g. “8447” (For EPSG:8447).

This is only available for single step coordinate operations. For multi-step operations, check operationDetails instead.

grids

Contains a list of transform grids used by the operation.

isAvailable

True if operation is available.

If False, it likely means a transform grid is required which is not available.

name

Display name of transform operation

operationDetails

Contains information about the single operation steps used in the transform operation.

Note

Only used in builds based on on Proj >= 6.2

Added in version 3.10.

proj

Proj representation of transform operation

remarks

Remarks for operation, from EPSG registry database.

This is only available for single step coordinate operations. For multi-step operations, check operationDetails instead.

scope

Scope of operation, from EPSG registry database.

This is only available for single step coordinate operations. For multi-step operations, check operationDetails instead.

class TransformInfo

Bases: object

Contains datum transform information.

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

datumTransformId

Datum transform ID

deprecated

True if transform is deprecated

destinationCrsAuthId

Destination CRS auth ID

destinationCrsDescription

Destination CRS description

epsgCode

EPSG code for the transform, or 0 if not found in EPSG database

preferred

True if transform is the preferred transform to use for the source/destination CRS combination

remarks

Transform remarks

scope

Scope of transform

sourceCrsAuthId

Source CRS auth ID

sourceCrsDescription

Source CRS description

class TransformPair

Bases: object

Contains datum transform information.

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

destinationTransformId

ID for the datum transform to use when projecting to the destination CRS.

See also

QgsCoordinateTransform.datumTransformCrsInfo()

sourceTransformId

ID for the datum transform to use when projecting from the source CRS.

See also

QgsCoordinateTransform.datumTransformCrsInfo()

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