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

FilePathType

Bases: enum.IntEnum

MeshEditingErrorType

Bases: enum.IntEnum

PythonMacroMode

Bases: enum.IntEnum

RasterPipeInterfaceRole

Bases: enum.IntEnum

RasterResamplingStage

Bases: enum.IntEnum

ScaleMethod

Bases: enum.IntEnum

SelectBehavior

Bases: enum.IntEnum

SqlKeywordCategory

Bases: enum.IntEnum

SqlLayerDefinitionCapability

Bases: enum.IntEnum

SublayerPromptMode

Bases: enum.IntEnum

SublayerQueryFlag

Bases: enum.IntEnum

SymbolFlag

Bases: enum.IntEnum

SymbolPreviewFlag

Bases: enum.IntEnum

SymbolRenderHint

Bases: enum.IntEnum

SymbolType

Bases: enum.IntEnum

UnplacedLabelVisibility

Bases: enum.IntEnum

VectorEditResult

Bases: enum.IntEnum

VectorExportResult

Bases: enum.IntEnum

VertexMarkerType

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

class FilePathType(value)

Bases: enum.IntEnum

File path types.

New in version 3.22.

  • Absolute: Absolute path

  • Relative: Relative path

Absolute = 0
Relative = 1
baseClass

alias of qgis._core.Qgis

Info = 0
class MeshEditingErrorType(value)

Bases: enum.IntEnum

Type of error that can occur during mesh frame editing.

New in version 3.22.

  • NoError: No type

  • InvalidFace: An error occurs due to an invalid face (for example, vertex indexes are unordered)

  • TooManyVerticesInFace: A face has more vertices than the maximum number supported per face

  • FlatFace: A flat face is present

  • UniqueSharedVertex: A least two faces share only one vertices

  • InvalidVertex: An error occurs due to an invalid vertex (for example, vertex index is out of range the available vertex)

  • ManifoldFace: ManifoldFace

FlatFace = 3
InvalidFace = 1
InvalidVertex = 5
ManifoldFace = 6
NoError = 0
TooManyVerticesInFace = 2
UniqueSharedVertex = 4
baseClass

alias of qgis._core.Qgis

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 = 'Master'
QGIS_VERSION = '3.21.0-Master'
QGIS_VERSION_INT = 32100
class RasterPipeInterfaceRole(value)

Bases: enum.IntEnum

Raster pipe interface roles.

New in version 3.22.

  • UnknownRole: Unknown role

  • ProviderRole: Data provider role

  • RendererRole: Raster renderer role

  • BrightnessRole: Brightness filter role

  • ResamplerRole: Resampler role

  • ProjectorRole: Projector role

  • NullerRole: Raster nuller role

  • HueSaturationRole: Hue/saturation filter role (also applies grayscale/color inversion)

baseClass

alias of qgis._core.Qgis

class RasterResamplingStage(value)

Bases: enum.IntEnum

Stage at which raster resampling occurs.

New in version 3.22.

  • ResampleFilter:

  • Provider:

baseClass

alias of qgis._core.Qgis

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

class SelectBehavior(value)

Bases: enum.IntEnum

Specifies how a selection should be applied.

New in version 3.22.

  • SetSelection: Set selection, removing any existing selection

  • AddToSelection: Add selection to current selection

  • IntersectSelection: Modify current selection to include only select features which match

  • RemoveFromSelection: Remove from current selection

baseClass

alias of qgis._core.Qgis

class SqlKeywordCategory(value)

Bases: enum.IntEnum

SqlKeywordCategory enum represents the categories of the SQL keywords used by the SQL query editor.

Note

The category has currently no usage, but it was planned for future uses.

New in version 3.22.

  • Keyword: SQL keyword

  • Constant: SQL constant

  • Function: SQL generic function

  • Geospatial: SQL spatial function

  • Operator: SQL operator

  • Math: SQL math function

  • Aggregate: SQL aggregate function

  • String: SQL string function

  • Identifier: SQL identifier

Aggregate = 6
Constant = 1
Function = 2
Geospatial = 3
Identifier = 8
Keyword = 0
Math = 5
Operator = 4
String = 7
baseClass

alias of qgis._core.Qgis

class SqlLayerDefinitionCapabilities
class SqlLayerDefinitionCapabilities(Union[Qgis.SqlLayerDefinitionCapabilities, Qgis.SqlLayerDefinitionCapability])None
class SqlLayerDefinitionCapabilities(Qgis.SqlLayerDefinitionCapabilities)None

Bases: sip.wrapper

class SqlLayerDefinitionCapability(value)

Bases: enum.IntEnum

SqlLayerDefinitionCapability enum lists the arguments supported by the provider when creating SQL query layers.

New in version 3.22.

  • SubsetStringFilter: SQL layer definition supports subset string filter

  • GeometryColumn: SQL layer definition supports geometry column

  • PrimaryKeys: SQL layer definition supports primary keys

  • UnstableFeatureIds: SQL layer definition supports disabling select at id

GeometryColumn = 4
PrimaryKeys = 8
SubsetStringFilter = 2
UnstableFeatureIds = 16
baseClass

alias of qgis._core.Qgis

class SublayerPromptMode(value)

Bases: enum.IntEnum

Specifies how to handle layer sources with multiple sublayers.

New in version 3.22.

  • AlwaysAsk: Always ask users to select from available sublayers, if sublayers are present

  • AskExcludingRasterBands: Ask users to select from available sublayers, unless only raster bands are present

  • NeverAskSkip: Never ask users to select sublayers, instead don’t load anything

  • NeverAskLoadAll: Never ask users to select sublayers, instead automatically load all available sublayers

AlwaysAsk = 0
AskExcludingRasterBands = 1
NeverAskLoadAll = 3
NeverAskSkip = 2
baseClass

alias of qgis._core.Qgis

class SublayerQueryFlag(value)

Bases: enum.IntEnum

Flags which control how data providers will scan for sublayers in a dataset.

New in version 3.22.

  • FastScan: Indicates that the provider must scan for sublayers using the fastest possible approach – e.g. by first checking that a uri has an extension which is known to be readable by the provider

  • ResolveGeometryType: Attempt to resolve the geometry type for vector sublayers

  • CountFeatures: Count features in vector sublayers

CountFeatures = 4
FastScan = 1
ResolveGeometryType = 2
baseClass

alias of qgis._core.Qgis

class SublayerQueryFlags
class SublayerQueryFlags(Union[Qgis.SublayerQueryFlags, Qgis.SublayerQueryFlag])None
class SublayerQueryFlags(Qgis.SublayerQueryFlags)None

Bases: sip.wrapper

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 VectorEditResult(value)

Bases: enum.IntEnum

Specifies the result of a vector layer edit operation

New in version 3.22.

  • Success: Edit operation was successful

  • EmptyGeometry: Edit operation resulted in an empty geometry

  • EditFailed: Edit operation failed

  • FetchFeatureFailed: Unable to fetch requested feature

  • InvalidLayer: Edit failed due to invalid layer

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

class VertexMarkerType(value)

Bases: enum.IntEnum

Editing vertex markers, used for showing vertices during a edit operation.

New in version 3.22.

  • SemiTransparentCircle: Semi-transparent circle marker

  • Cross: Cross marker

  • NoMarker: No marker

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