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
parentobject.- Parameters:
parent (Optional[QObject] = None)
- class CustomRole(*values)¶
Bases:
IntEnumCustom 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.RoleNodeTypein older QGIS releases.Name: The coordinate reference system nameAvailable as
QgsCoordinateReferenceSystemModel.RoleNamein older QGIS releases.AuthId: The coordinate reference system authority name and idAvailable as
QgsCoordinateReferenceSystemModel.RoleAuthIdin older QGIS releases.Deprecated:Trueif the CRS is deprecatedAvailable as
QgsCoordinateReferenceSystemModel.RoleDeprecatedin older QGIS releases.Type: The coordinate reference system typeAvailable as
QgsCoordinateReferenceSystemModel.RoleTypein older QGIS releases.GroupId: The node ID (for group nodes)Available as
QgsCoordinateReferenceSystemModel.RoleGroupIdin 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.RoleWktin 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.RoleProjin 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
crsto 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