Class: QgsCoordinateReferenceSystemUtils

Utility functions for working with QgsCoordinateReferenceSystem objects.

Added in version 3.26.

Static Methods

axisDirectionToAbbreviatedString

Returns a translated abbreviation representing an axis direction.

crsTypeToString

Returns a translated string representing a CRS type.

defaultCoordinateOrderForCrs

Returns the default coordinate order to use for the specified crs.

translateProjection

Returns a translated string for a projection method.

class qgis.core.QgsCoordinateReferenceSystemUtils[source]

Bases: object

static axisDirectionToAbbreviatedString(axis: Qgis.CrsAxisDirection) str[source]

Returns a translated abbreviation representing an axis direction.

Parameters:

axis (Qgis.CrsAxisDirection)

Return type:

str

static crsTypeToString(type: Qgis.CrsType) str[source]

Returns a translated string representing a CRS type.

Added in version 3.34.

Parameters:

type (Qgis.CrsType)

Return type:

str

static defaultCoordinateOrderForCrs(crs: QgsCoordinateReferenceSystem) Qgis.CoordinateOrder[source]

Returns the default coordinate order to use for the specified crs.

Warning

This is quite a “coarse” method, in that many possible CRS axis don’t map well to a simply X/Y or Y/X order. Accordingly this method will default to returning Qgis.CoordinateOrder.XY unless we are reasonably certain of a Y/X order.

Parameters:

crs (QgsCoordinateReferenceSystem)

Return type:

Qgis.CoordinateOrder

static translateProjection(projection: str | None) str[source]

Returns a translated string for a projection method.

Returns an empty string for unhandled methods.

Added in version 3.34.

Parameters:

projection (Optional[str])

Return type:

str