Class: QgsEllipsoidUtils

Contains utility functions for working with ellipsoids and querying the ellipsoid database.

Static Methods

acronyms

Returns a list of all known ellipsoid acronyms from the internal ellipsoid database.

celestialBodies

Returns a list of all known celestial bodies.

definitions

Returns a list of the definitions for all known ellipsoids from the internal ellipsoid database.

ellipsoidParameters

Returns the parameters for the specified ellipsoid.

class qgis.core.QgsEllipsoidUtils[source]

Bases: object

class EllipsoidDefinition

Bases: object

Contains definition of an ellipsoid.

acronym

authority:code for QGIS builds with proj version 6 or greater, or custom acronym for ellipsoid for earlier proj builds

celestialBodyName

Name of the associated celestial body (e.g. “Earth”).

Warning

This method requires PROJ 8.1 or later. On earlier PROJ builds the string will always be empty.

Added in version 3.20.

description

Description of ellipsoid

parameters

Ellipsoid parameters

class EllipsoidParameters

Bases: object

Contains parameters for an ellipsoid.

crs

Associated coordinate reference system

inverseFlattening

Inverse flattening

semiMajor

Semi-major axis

semiMinor

Semi-minor axis

useCustomParameters

Whether custom parameters alone should be used (semiMajor/semiMinor only)

valid

Whether ellipsoid parameters are valid

static acronyms() List[str][source]

Returns a list of all known ellipsoid acronyms from the internal ellipsoid database.

See also

definitions()

Return type:

List[str]

static celestialBodies() List[QgsCelestialBody]

Returns a list of all known celestial bodies.

Note

This method is an alias for QgsCoordinateReferenceSystemRegistry.celestialBodies().

Warning

This method requires PROJ 8.1 or later

Raises:

QgsNotSupportedException – on QGIS builds based on PROJ 8.0 or earlier.

Added in version 3.20.

Return type:

List[QgsCelestialBody]

static definitions() List[QgsEllipsoidUtils.EllipsoidDefinition]

Returns a list of the definitions for all known ellipsoids from the internal ellipsoid database.

See also

acronyms()

Return type:

List[QgsEllipsoidUtils.EllipsoidDefinition]

static ellipsoidParameters(ellipsoid: str | None) QgsEllipsoidUtils.EllipsoidParameters[source]

Returns the parameters for the specified ellipsoid. Results are cached to allow for fast retrieval of parameters.

Parameters:

ellipsoid (Optional[str])

Return type:

QgsEllipsoidUtils.EllipsoidParameters