Class: QgsTolerance¶
- class qgis.core.QgsTolerance¶
Bases:
sip.wrapper
This is the class is providing tolerance value in map unit values.
Enums
alias of
MapToolUnit
Methods
Static function to get default tolerance value for a layer.
Static function to translate tolerance value into layer units
Static function to translate tolerance value into map units
Static function to get vertex tolerance value.
Attributes
- UnitType¶
alias of
MapToolUnit
- 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.
- Return type:
float
- Returns:
value of default tolerance in layer units
- Parameters:
layer (QgsMapLayer) –
mapSettings (QgsMapSettings) –
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- toleranceInMapUnits(tolerance: float, layer: QgsMapLayer, mapSettings: QgsMapSettings, units: Qgis.MapToolUnit = Qgis.MapToolUnit.Layer) float ¶
Static function to translate tolerance value into layer units
- Parameters:
tolerance (float) – tolerance value to be translated
layer (QgsMapLayer) – reference layer
mapSettings (QgsMapSettings) – settings of the map
units (Qgis.MapToolUnit = Qgis.MapToolUnit.Layer) – type of units to be translated
- Return type:
float
- Returns:
value of tolerance in layer units
- toleranceInProjectUnits(tolerance: float, layer: QgsMapLayer, mapSettings: QgsMapSettings, units: Qgis.MapToolUnit) float ¶
Static function to translate tolerance value into map units
- Parameters:
tolerance (float) – tolerance value to be translated
layer (QgsMapLayer) – source layer necessary in case tolerance is in layer units
mapSettings (QgsMapSettings) – settings of the map
units (Qgis.MapToolUnit) – type of units to be translated
- Return type:
float
- Returns:
value of tolerance in map units
- 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)
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.- Return type:
float
- Returns:
value of vertex tolerance in layer units
- Parameters:
mapSettings (QgsMapSettings) –