Class: QgsMapClippingRegion¶
- class qgis.core.QgsMapClippingRegion(geometry: QgsGeometry)¶
Bases:
sip.wrapper
Constructor for a map clipping region, with the specified
geometry
in the destination map CRS.QgsMapClippingRegion(
QgsMapClippingRegion
)A map clipping region (in map coordinates and CRS).
New in version 3.16: Enums
Bases:
enum.IntEnum
Methods
Returns
True
if the clipping region should be applied to the specified maplayer
.Returns the feature clipping type.
Returns the geometry of the clipping region (in the destination map CRS).
Returns
True
if clipping should be restricted to a subset of layers.Returns the list of layers to restrict the clipping region effects to.
Sets the feature clipping
type
.Sets the clipping region
geometry
(in the destination map CRS).Sets whether clipping should be restricted to a subset of layers.
Sets a list of
layers
to restrict the clipping region effects to.- class FeatureClippingType(value)¶
Bases:
enum.IntEnum
Feature clipping behavior, which controls how features from vector layers will be clipped.
ClipToIntersection
: Clip the geometry of these features to the region prior to rendering (i.e. feature boundaries will follow the clip region)ClipPainterOnly
: Applying clipping on the painter only (i.e. feature boundaries will be unchanged, but may be invisible where the feature falls outside the clipping region)NoClipping
: Only render features which intersect the clipping region, but do not clip these features to the region
- ClipPainterOnly = 1¶
- ClipToIntersection = 0¶
- NoClipping = 2¶
- appliesToLayer(self, layer: QgsMapLayer) → bool¶
Returns
True
if the clipping region should be applied to the specified maplayer
.- Parameters
layer (QgsMapLayer) –
- Return type
bool
- featureClip(self) → QgsMapClippingRegion.FeatureClippingType¶
Returns the feature clipping type.
This setting is only used while rendering vector layers, for other layer types it is ignored.
See also
- Return type
- geometry(self) → QgsGeometry¶
Returns the geometry of the clipping region (in the destination map CRS).
See also
- Return type
- restrictToLayers(self) → bool¶
Returns
True
if clipping should be restricted to a subset of layers.See also
See also
- Return type
bool
- restrictedLayers(self) → List[QgsMapLayer]¶
Returns the list of layers to restrict the clipping region effects to.
If the list is empty then the clipping will be applied to all layers.
Note
This setting is only used if
restrictToLayers()
isTrue
.See also
See also
- Return type
List[QgsMapLayer]
- setFeatureClip(self, type: QgsMapClippingRegion.FeatureClippingType)¶
Sets the feature clipping
type
.This setting is only used while rendering vector layers, for other layer types it is ignored.
See also
- Parameters
- setGeometry(self, geometry: QgsGeometry)¶
Sets the clipping region
geometry
(in the destination map CRS).See also
- Parameters
geometry (QgsGeometry) –
- setRestrictToLayers(self, enabled: bool)¶
Sets whether clipping should be restricted to a subset of layers.
See also
See also
- Parameters
enabled (bool) –
- setRestrictedLayers(self, layers: Iterable[QgsMapLayer])¶
Sets a list of
layers
to restrict the clipping region effects to.By default the clipping region applies to all layers.
Note
This setting is only used if
restrictToLayers()
isTrue
.See also
See also
- Parameters
layers (Iterable[QgsMapLayer]) –