Class: QgsTolerance

class qgis.core.QgsTolerance

Bases: sip.wrapper

This is the class is providing tolerance value in map unit values.

Methods

defaultTolerance Static function to get default tolerance value for a layer.
toleranceInMapUnits Static function to translate tolerance value into layer units
toleranceInProjectUnits Static function to translate tolerance value into map units
vertexSearchRadius Static function to get vertex tolerance value.

Signals

Attributes

LayerUnits
Pixels
ProjectUnits
staticMetaObject
LayerUnits = 0
Pixels = 1
ProjectUnits = 2
class UnitType

Bases: int

baseClass

alias of QgsTolerance

defaultTolerance(layer: QgsMapLayer, mapSettings: QgsMapSettings) → float

Static function to get default tolerance value for a layer. The value is read from settings and transformed if necessary.

Returns:value of default tolerance in layer units
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
toleranceInMapUnits(tolerance: float, layer: QgsMapLayer, mapSettings: QgsMapSettings, units: QgsTolerance.UnitType = QgsTolerance.LayerUnits) → float

Static function to translate tolerance value into layer units

Parameters:
  • tolerance – tolerance value to be translated
  • layer – reference layer
  • mapSettings – settings of the map
  • units – type of units to be translated
Returns:

value of tolerance in layer units

toleranceInProjectUnits(tolerance: float, layer: QgsMapLayer, mapSettings: QgsMapSettings, units: QgsTolerance.UnitType) → float

Static function to translate tolerance value into map units

Parameters:
  • tolerance – tolerance value to be translated
  • layer – source layer necessary in case tolerance is in layer units
  • mapSettings – settings of the map
  • units – type of units to be translated
Returns:

value of tolerance in map units

New in version 2.8.

vertexSearchRadius(mapSettings: QgsMapSettings) → float

Static function to get vertex tolerance value. The value is read from settings and transformed if necessary.

Returns:value of vertex tolerance in map units (not layer units)

New in version 2.8.

vertexSearchRadius(layer: QgsMapLayer, mapSettings: QgsMapSettings) -> float Static function to get vertex tolerance value for a layer. The value is read from settings and transformed if necessary.

Returns:value of vertex tolerance in layer units