Class: Qgis

class qgis.core.Qgis

Bases: sip.wrapper

The Qgis class provides global constants for use throughout the application.

Enums

BrowserDirectoryMonitoring

Bases: enum.IntEnum

BrowserItemCapability

Bases: enum.IntEnum

BrowserItemState

Bases: enum.IntEnum

BrowserItemType

Bases: enum.IntEnum

BrowserLayerType

Bases: enum.IntEnum

DataType

Bases: enum.IntEnum

DriveType

Bases: enum.IntEnum

FeatureCountState

Bases: enum.IntEnum

PythonMacroMode

Bases: enum.IntEnum

ScaleMethod

Bases: enum.IntEnum

SymbolFlag

Bases: enum.IntEnum

SymbolPreviewFlag

Bases: enum.IntEnum

SymbolRenderHint

Bases: enum.IntEnum

SymbolType

Bases: enum.IntEnum

UnplacedLabelVisibility

Bases: enum.IntEnum

VectorExportResult

Bases: enum.IntEnum

Methods

defaultProjectScales

A string with default project scales.

devVersion

The development version

geosVersion

GEOS string version linked

geosVersionInt

GEOS version number linked

geosVersionMajor

GEOS Major version number linked

geosVersionMinor

GEOS Minor version number linked

geosVersionPatch

GEOS Patch version number linked

releaseName

Release name

version

Version string.

versionInt

Version number used for comparing versions using the "Check QGIS Version" function

Attributes

Critical

DEFAULT_HIGHLIGHT_BUFFER_MM

DEFAULT_HIGHLIGHT_COLOR

DEFAULT_HIGHLIGHT_MIN_WIDTH_MM

DEFAULT_MAPTOPIXEL_THRESHOLD

DEFAULT_M_COORDINATE

DEFAULT_SEARCH_RADIUS_MM

DEFAULT_SNAP_TOLERANCE

DEFAULT_SNAP_UNITS

DEFAULT_Z_COORDINATE

Info

NoLevel

QGIS_DEV_VERSION

QGIS_RELEASE_NAME

QGIS_VERSION

QGIS_VERSION_INT

SCALE_PRECISION

Success

UI_SCALE_FACTOR

Warning

staticMetaObject

class BrowserDirectoryMonitoring(value)

Bases: enum.IntEnum

Browser directory item monitoring switches.

New in version 3.20.

  • Default: Use default logic to determine whether directory should be monitored

  • NeverMonitor: Never monitor the directory, regardless of the default logic

  • AlwaysMonitor: Always monitor the directory, regardless of the default logic

AlwaysMonitor = 2
Default = 0
NeverMonitor = 1
baseClass

alias of qgis._core.Qgis

class BrowserItemCapabilities
class BrowserItemCapabilities(Union[Qgis.BrowserItemCapabilities, Qgis.BrowserItemCapability]) None
class BrowserItemCapabilities(Qgis.BrowserItemCapabilities) None

Bases: sip.wrapper

class BrowserItemCapability(value)

Bases: enum.IntEnum

Browser item capabilities.

New in version 3.20.

  • NoCapabilities: Item has no capabilities

  • SetCrs: Can set CRS on layer or group of layers. deprecated since QGIS 3.6 – no longer used by QGIS and will be removed in QGIS 4.0

  • Fertile: Can create children. Even items without this capability may have children, but cannot create them, it means that children are created by item ancestors.

  • Fast: CreateChildren() is fast enough to be run in main thread when refreshing items, most root items (wms,wfs,wcs,postgres…) are considered fast because they are reading data only from QgsSettings

  • Collapse: The collapse/expand status for this items children should be ignored in order to avoid undesired network connections (wms etc.)

  • Rename: Item can be renamed

  • Delete: Item can be deleted

baseClass

alias of qgis._core.Qgis

class BrowserItemState(value)

Bases: enum.IntEnum

Browser item states.

New in version 3.20.

  • NotPopulated: Children not yet created

  • Populating: Creating children in separate thread (populating or refreshing)

  • Populated: Children created

baseClass

alias of qgis._core.Qgis

class BrowserItemType(value)

Bases: enum.IntEnum

Browser item types.

New in version 3.20.

  • Collection: A collection of items

  • Directory: Represents a file directory

  • Layer: Represents a map layer

  • Error: Contains an error message

  • Favorites: Represents a favorite item

  • Project: Represents a QGIS project

  • Custom: Custom item type

  • Fields: Collection of fields

  • Field: Vector layer field

baseClass

alias of qgis._core.Qgis

class BrowserLayerType(value)

Bases: enum.IntEnum

Browser item layer types

New in version 3.20.

  • NoType: No type

  • Vector: Generic vector layer

  • Raster: Raster layer

  • Point: Vector point layer

  • Line: Vector line layer

  • Polygon: Vector polygon layer

  • TableLayer: Vector non-spatial layer

  • Database: Database layer

  • Table: Database table

  • Plugin: Plugin based layer

  • Mesh: Mesh layer

  • VectorTile: Vector tile layer

  • PointCloud: Point cloud layer

baseClass

alias of qgis._core.Qgis

Critical = 2
DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5
DEFAULT_HIGHLIGHT_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0
DEFAULT_M_COORDINATE = 0.0
DEFAULT_SEARCH_RADIUS_MM = 2.0
DEFAULT_SNAP_TOLERANCE = 12.0
DEFAULT_SNAP_UNITS = 1
DEFAULT_Z_COORDINATE = 0.0
class DataType(value)

Bases: enum.IntEnum

Raster data types. This is modified and extended copy of GDALDataType.

  • UnknownDataType: Unknown or unspecified type

  • Byte: Eight bit unsigned integer (quint8)

  • UInt16: Sixteen bit unsigned integer (quint16)

  • Int16: Sixteen bit signed integer (qint16)

  • UInt32: Thirty two bit unsigned integer (quint32)

  • Int32: Thirty two bit signed integer (qint32)

  • Float32: Thirty two bit floating point (float)

  • Float64: Sixty four bit floating point (double)

  • CInt16: Complex Int16

  • CInt32: Complex Int32

  • CFloat32: Complex Float32

  • CFloat64: Complex Float64

  • ARGB32: Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32

  • ARGB32_Premultiplied: Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied

baseClass

alias of qgis._core.Qgis

class DriveType(value)

Bases: enum.IntEnum

Drive types

New in version 3.20.

  • Unknown: Unknown type

  • Invalid: Invalid path

  • Removable: Removable drive

  • Fixed: Fixed drive

  • Remote: Remote drive

  • CdRom: CD-ROM

  • RamDisk: RAM disk

CdRom = 5
Fixed = 3
Invalid = 1
RamDisk = 6
Remote = 4
Removable = 2
Unknown = 0
baseClass

alias of qgis._core.Qgis

class FeatureCountState(value)

Bases: enum.IntEnum

Enumeration of feature count states

New in version 3.20.

  • Uncounted: Feature count not yet computed

  • UnknownCount: Provider returned an unknown feature count

baseClass

alias of qgis._core.Qgis

Info = 0
class MessageLevel

Bases: int

baseClass

alias of qgis._core.Qgis

NoLevel = 4
class PythonMacroMode(value)

Bases: enum.IntEnum

Authorisation to run Python Macros

New in version 3.10.

  • Never: Macros are never run

  • Ask: User is prompt before running

  • SessionOnly: Only during this session

  • Always: Macros are always run

  • NotForThisSession: Macros will not be run for this session

baseClass

alias of qgis._core.Qgis

QGIS_DEV_VERSION = 'exported'
QGIS_RELEASE_NAME = 'Odense'
QGIS_VERSION = '3.20.3-Odense'
QGIS_VERSION_INT = 32003
SCALE_PRECISION = 0.9999999999
class ScaleMethod(value)

Bases: enum.IntEnum

Scale methods

New in version 3.20.

  • ScaleArea: Calculate scale by the area

  • ScaleDiameter: Calculate scale by the diameter

baseClass

alias of qgis._core.Qgis

Success = 3
class SymbolFlag(value)

Bases: enum.IntEnum

Flags controlling behavior of symbols

New in version 3.20.

  • RendererShouldUseSymbolLevels: If present, indicates that a QgsFeatureRenderer using the symbol should use symbol levels for best results

RendererShouldUseSymbolLevels = 1
baseClass

alias of qgis._core.Qgis

class SymbolFlags
class SymbolFlags(Union[Qgis.SymbolFlags, Qgis.SymbolFlag]) None
class SymbolFlags(Qgis.SymbolFlags) None

Bases: sip.wrapper

class SymbolPreviewFlag(value)

Bases: enum.IntEnum

Flags for controlling how symbol preview images are generated.

New in version 3.20.

  • FlagIncludeCrosshairsForMarkerSymbols: Include a crosshairs reference image in the background of marker symbol previews

baseClass

alias of qgis._core.Qgis

class SymbolPreviewFlags
class SymbolPreviewFlags(Union[Qgis.SymbolPreviewFlags, Qgis.SymbolPreviewFlag]) None
class SymbolPreviewFlags(Qgis.SymbolPreviewFlags) None

Bases: sip.wrapper

class SymbolRenderHint(value)

Bases: enum.IntEnum

Flags controlling behavior of symbols during rendering

New in version 3.20.

  • DynamicRotation: Rotation of symbol may be changed during rendering and symbol should not be cached

baseClass

alias of qgis._core.Qgis

class SymbolRenderHints
class SymbolRenderHints(Union[Qgis.SymbolRenderHints, Qgis.SymbolRenderHint]) None
class SymbolRenderHints(Qgis.SymbolRenderHints) None

Bases: sip.wrapper

class SymbolType(value)

Bases: enum.IntEnum

Symbol types

New in version 3.20.

  • Marker: Marker symbol

  • Line: Line symbol

  • Fill: Fill symbol

  • Hybrid: Hybrid symbol

baseClass

alias of qgis._core.Qgis

UI_SCALE_FACTOR = 1.0
class UnplacedLabelVisibility(value)

Bases: enum.IntEnum

Unplaced label visibility.

New in version 3.20.

  • FollowEngineSetting: Respect the label engine setting

  • NeverShow: Never show unplaced labels, regardless of the engine setting

FollowEngineSetting = 0
NeverShow = 1
baseClass

alias of qgis._core.Qgis

class VectorExportResult(value)

Bases: enum.IntEnum

Vector layer export result codes.

New in version 3.20.

  • NoError: No errors were encountered

  • ErrCreateDataSource: Could not create the destination data source

  • ErrCreateLayer: Could not create destination layer

  • ErrAttributeTypeUnsupported: Source layer has an attribute type which could not be handled by destination

  • ErrAttributeCreationFailed: Destination provider was unable to create an attribute

  • ErrProjection: An error occurred while reprojecting features to destination CRS

  • ErrFeatureWriteFailed: An error occurred while writing a feature to the destination

  • ErrInvalidLayer: Could not access newly created destination layer

  • ErrInvalidProvider: Could not find a matching provider key

  • ErrProviderUnsupportedFeature: Provider does not support creation of empty layers

  • ErrConnectionFailed: Could not connect to destination

  • ErrUserCanceled: User canceled the export

baseClass

alias of qgis._core.Qgis

Warning = 1
defaultProjectScales() str

A string with default project scales.

New in version 3.12.

Return type

str

devVersion() str

The development version

New in version 3.12.

Return type

str

geosVersion() str

GEOS string version linked

New in version 3.20.

Return type

str

geosVersionInt() int

GEOS version number linked

New in version 3.20.

Return type

int

geosVersionMajor() int

GEOS Major version number linked

New in version 3.20.

Return type

int

geosVersionMinor() int

GEOS Minor version number linked

New in version 3.20.

Return type

int

geosVersionPatch() int

GEOS Patch version number linked

New in version 3.20.

Return type

int

releaseName() str

Release name

New in version 3.12.

Return type

str

staticMetaObject = <PyQt5.QtCore.QMetaObject object>
version() str

Version string.

New in version 3.12.

Return type

str

versionInt() int

Version number used for comparing versions using the “Check QGIS Version” function

New in version 3.12.

Return type

int