Class: QgsMapSettingsUtils

Utilities for map settings.

List of all members, including inherited members

Enums

EffectsCheckFlag

Flags for controlling the behavior of containsAdvancedEffects()

Methods

EffectsCheckFlags

Static Methods

containsAdvancedEffects

Checks whether any of the layers attached to a map settings object contain advanced effects.

isValidExtent

Returns True if an extent is a valid extent which can be used by QgsMapSettings.

worldFileContent

Creates the content of a world file.

worldFileParameters

Computes the six parameters of a world file.

class qgis.core.QgsMapSettingsUtils[source]

Bases: object

class EffectsCheckFlag(*values)

Bases: IntFlag

Flags for controlling the behavior of containsAdvancedEffects()

Added in version 3.14.

  • IgnoreGeoPdfSupportedEffects: Ignore advanced effects which are supported in geospatial PDF exports

IgnoreGeoPdfSupportedEffects = 1
EffectsCheckFlags()
static containsAdvancedEffects(mapSettings: QgsMapSettings, flags: QgsMapSettingsUtils.EffectsCheckFlag = QgsMapSettingsUtils.EffectsCheckFlags()) list[str][source]

Checks whether any of the layers attached to a map settings object contain advanced effects.

The optional flags argument can be used to fine-tune the check behavior.

Parameters:
  • mapSettings (QgsMapSettings)

  • flags (QgsMapSettingsUtils.EffectsCheckFlag = QgsMapSettingsUtils.EffectsCheckFlags())

Return type:

list[str]

static isValidExtent(extent: QgsRectangle) bool[source]

Returns True if an extent is a valid extent which can be used by QgsMapSettings.

An extent will be considered invalid if it:

  • is empty

  • is non-finite

  • is so small it can’t be accurately represented using double precision values

Added in version 4.0.

Parameters:

extent (QgsRectangle)

Return type:

bool

static worldFileContent(mapSettings: QgsMapSettings) str[source]

Creates the content of a world file.

Parameters:

mapSettings (QgsMapSettings) – map settings

Note

Uses 17 places of precision for all numbers output

Return type:

str

static worldFileParameters(mapSettings: QgsMapSettings)[source]

Computes the six parameters of a world file.

Parameters:

mapSettings (QgsMapSettings) – map settings

Return type:

(float, float, float, float, float, float)

Returns:

  • a: the a parameter

  • b: the b parameter

  • c: the c parameter

  • d: the d parameter

  • e: the e parameter

  • f: the f parameter

Added in version 3.10.