Class: QgsCoordinateReferenceSystemModel¶
A tree model for display of known coordinate reference systems.
Added in version 3.34.
Class Hierarchy¶
Base classes¶
Enums
Custom model roles. |
|
alias of |
Methods
Adds a custom crs to the model. |
|
Retrieves the model index corresponding to a CRS with the specified authId. |
- class qgis.gui.QgsCoordinateReferenceSystemModel[source]¶
Bases:
QAbstractItemModel
- __init__(parent: QObject | None = None)
Constructor for QgsCoordinateReferenceSystemModel, with the specified
parent
object.- Parameters:
parent (Optional[QObject] = None)
- class CustomRole(*values)¶
Bases:
IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsCoordinateReferenceSystemModel.Roles
Added in version 3.36.
NodeType
: Corresponds to the node’s typeAvailable as
QgsCoordinateReferenceSystemModel.RoleNodeType
in older QGIS releases.Name
: The coordinate reference system nameAvailable as
QgsCoordinateReferenceSystemModel.RoleName
in older QGIS releases.AuthId
: The coordinate reference system authority name and idAvailable as
QgsCoordinateReferenceSystemModel.RoleAuthId
in older QGIS releases.Deprecated
:True
if the CRS is deprecatedAvailable as
QgsCoordinateReferenceSystemModel.RoleDeprecated
in older QGIS releases.Type
: The coordinate reference system typeAvailable as
QgsCoordinateReferenceSystemModel.RoleType
in older QGIS releases.GroupId
: The node ID (for group nodes)Available as
QgsCoordinateReferenceSystemModel.RoleGroupId
in older QGIS releases.Wkt
: The coordinate reference system’s WKT representation. This is only used for non-standard CRS (i.e. those not present in the database).Available as
QgsCoordinateReferenceSystemModel.RoleWkt
in older QGIS releases.Proj
: The coordinate reference system’s PROJ representation. This is only used for non-standard CRS (i.e. those not present in the database).Available as
QgsCoordinateReferenceSystemModel.RoleProj
in older QGIS releases.Group
: Group name.Added in version 3.42.
Projection
: Projection name.Added in version 3.42.
- Roles¶
alias of
CustomRole
- addCustomCrs(self, crs: QgsCoordinateReferenceSystem) QModelIndex [source]¶
Adds a custom
crs
to the model.This method can be used to add CRS which aren’t present in either the standard PROJ SRS database or the user’s custom CRS database to the model.
- Parameters:
- Return type:
QModelIndex