Class: QgsLayoutAtlas¶
-
class
qgis.core.
QgsLayoutAtlas
(layout: QgsLayout)¶ Bases:
PyQt5.QtCore.QObject
,qgis._core.QgsAbstractLayoutIterator
,qgis._core.QgsLayoutSerializableObject
Constructor for new QgsLayoutAtlas.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
QgsLayoutAtlas implement the QgsAbstractLayoutIterator interface, allowing them to be used directly with QgsLayoutExporter to automatically output all pages from the atlas.
For QgsPrintLayout layouts, it is not necessary to manually construct a QgsLayoutAtlas object. Instead, the atlas attached to the print layout should be used. This can be retrieved by calling
QgsPrintLayout.atlas()
New in version 3.0: Enums
Methods
Returns the coverage layer used for the atlas features.
Returns the current feature number, where a value of 0 corresponds to the first feature.
Returns the current feature filename.
Returns whether the atlas generation is enabled
Returns the filename expression used for generating output filenames for each atlas page.
Returns the expression used for filtering features in the coverage layer.
Returns true if features should be filtered in the coverage layer.
Seeks to the first feature, returning false if no feature was found.
Returns true if the atlas is set to hide the coverage layer.
Seeks to the last feature, returning false if no feature was found.
Returns the calculated name for a specified atlas
page
number.Returns the expression (or field name) used for calculating the page name.
Iterates to the previous feature, returning false if no previous feature exists.
Refreshes the current atlas feature, by refetching its attributes from the vector layer provider
Seeks to the specified
feature
number.Sets the coverage
layer
to use for the atlas features.Sets whether the atlas is
enabled
.Sets the filename
expression
used for generating output filenames for each atlas page.Sets the
expression
used for filtering features in the coverage layer.Sets whether features should be
filtered
in the coverage layer.Sets whether the coverage layer should be hidden in map items in the layouts.
Sets the
expression
(or field name) used for calculating the page name.Sets whether features should be sorted in an ascending order.
Sets the
expression
(or field name) to use for sorting features.Sets whether features should be sorted in the atlas.
Returns true if features should be sorted in an ascending order.
Returns the expression (or field name) to use for sorting features.
Returns true if features should be sorted in the atlas.
Requeries the current atlas coverage layer and applies filtering and sorting.
Signals
Emitted when one of the atlas parameters changes.
Emitted when the coverage layer for the atlas changes.
Is emitted when the current atlas
feature
changes.Is emitted when the atlas has an updated status bar
message
.Emitted when the number of features for the atlas changes.
Emitted when atlas rendering has begun.
Emitted when atlas rendering has ended.
Emitted when atlas is enabled or disabled.
Attributes
-
beginRender
(self) → bool¶
-
changed
¶ Emitted when one of the atlas parameters changes. [signal]
-
childEvent
()¶
-
connectNotify
()¶
-
count
(self) → int¶
-
coverageLayer
(self) → QgsVectorLayer¶ Returns the coverage layer used for the atlas features.
See also
-
coverageLayerChanged
¶ Emitted when the coverage layer for the atlas changes. [signal]
-
currentFeatureNumber
(self) → int¶ Returns the current feature number, where a value of 0 corresponds to the first feature.
-
currentFilename
(self) → str¶ Returns the current feature filename.
See also
See also
-
customEvent
()¶
-
disconnectNotify
()¶
-
enabled
(self) → bool¶ Returns whether the atlas generation is enabled
See also
-
endRender
(self) → bool¶
-
featureChanged
¶ Is emitted when the current atlas
feature
changes. [signal]
-
filePath
(self, baseFilePath: str, extension: str) → str¶
-
filenameExpression
(self) → str¶ Returns the filename expression used for generating output filenames for each atlas page.
See also
See also
-
filterExpression
(self) → str¶ Returns the expression used for filtering features in the coverage layer.
This property has no effect is filterFeatures() is false.
See also
See also
-
filterFeatures
(self) → bool¶ Returns true if features should be filtered in the coverage layer.
See also
See also
-
first
(self) → bool¶ Seeks to the first feature, returning false if no feature was found.
See also
See also
See also
See also
-
hideCoverage
(self) → bool¶ Returns true if the atlas is set to hide the coverage layer.
See also
-
isSignalConnected
()¶
-
last
(self) → bool¶ Seeks to the last feature, returning false if no feature was found.
See also
See also
See also
See also
-
layout
(self) → QgsLayout¶
-
messagePushed
¶ Is emitted when the atlas has an updated status bar
message
. [signal]
-
nameForPage
(self, page: int) → str¶ Returns the calculated name for a specified atlas
page
number. Page numbers start at 0.See also
-
next
(self) → bool¶
-
numberFeaturesChanged
¶ Emitted when the number of features for the atlas changes. [signal]
-
pageNameExpression
(self) → str¶ Returns the expression (or field name) used for calculating the page name.
See also
See also
-
previous
(self) → bool¶ Iterates to the previous feature, returning false if no previous feature exists.
See also
See also
See also
See also
-
readXml
(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶
-
receivers
()¶
-
refreshCurrentFeature
(self)¶ Refreshes the current atlas feature, by refetching its attributes from the vector layer provider
-
renderBegun
¶ Emitted when atlas rendering has begun. [signal]
-
renderEnded
¶ Emitted when atlas rendering has ended. [signal]
-
seekTo
(self, feature: int) → bool¶ Seeks to the specified
feature
number.See also
See also
See also
See also
seekTo(self, feature: QgsFeature) -> bool Seeks to the specified
feature
.See also
See also
See also
See also
-
sender
()¶
-
senderSignalIndex
()¶
-
setCoverageLayer
(self, layer: QgsVectorLayer)¶ Sets the coverage
layer
to use for the atlas features.See also
-
setFilenameExpression
(self, expression: str) → Tuple[bool, str]¶ Sets the filename
expression
used for generating output filenames for each atlas page. If an invalid expression is passed, false will be returned anderrorString
will be set to the expression error.See also
See also
-
setFilterExpression
(self, expression: str) → Tuple[bool, str]¶ Sets the
expression
used for filtering features in the coverage layer.This property has no effect is filterFeatures() is false.
If an invalid expression is passed, false will be returned and
errorString
will be set to the expression error.See also
See also
-
setFilterFeatures
(self, filtered: bool)¶ Sets whether features should be
filtered
in the coverage layer.See also
See also
-
setHideCoverage
(self, hide: bool)¶ Sets whether the coverage layer should be hidden in map items in the layouts.
See also
-
setPageNameExpression
(self, expression: str)¶ Sets the
expression
(or field name) used for calculating the page name.See also
-
setSortAscending
(self, ascending: bool)¶ Sets whether features should be sorted in an ascending order.
This property has no effect is sortFeatures() is false.
See also
See also
See also
-
setSortExpression
(self, expression: str)¶ Sets the
expression
(or field name) to use for sorting features.This property has no effect is sortFeatures() is false.
See also
See also
See also
-
setSortFeatures
(self, enabled: bool)¶ Sets whether features should be sorted in the atlas.
See also
See also
See also
-
sortAscending
(self) → bool¶ Returns true if features should be sorted in an ascending order.
This property has no effect is sortFeatures() is false.
See also
See also
See also
-
sortExpression
(self) → str¶ Returns the expression (or field name) to use for sorting features.
This property has no effect is sortFeatures() is false.
See also
See also
See also
-
sortFeatures
(self) → bool¶ Returns true if features should be sorted in the atlas.
See also
See also
See also
-
stringType
(self) → str¶
-
timerEvent
()¶
-
toggled
¶ Emitted when atlas is enabled or disabled. [signal]
-
updateFeatures
(self) → int¶ Requeries the current atlas coverage layer and applies filtering and sorting. Returns number of matching features.
-
writeXml
(self, parentElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool¶
-