Class: QgsCoordinateReferenceSystemUtils

Utility functions for working with QgsCoordinateReferenceSystem objects.

Added in version 3.26.

List of all members, including inherited members

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.

topocentricHorizonGeometry

Builds the geometry of the visible horizon (in outputCrs) when topocentricCrs is a topocentric 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 topocentricHorizonGeometry(topocentricCrs: QgsCoordinateReferenceSystem, outputCrs: QgsCoordinateReferenceSystem, transformContext: QgsCoordinateTransformContext, degreeStep: float = 1) → QgsGeometry[source]

Builds the geometry of the visible horizon (in outputCrs) when topocentricCrs is a topocentric CRS.

The horizon is built up from points spaced at degreeStep degree intervals around the horizon.

Returns null geometry if topocentricCrs is not a topocentric CRS or if the transform fails.

Added in version 4.4.

Parameters:
Return type:

QgsGeometry

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 (str|None)

Return type:

str