Class: QgsMapToolDigitizeFeature¶
This tool digitizes geometry of new point/line/polygon features on already existing vector layers Once the map tool is enabled, user can digitize the feature geometry. A signal will then be emitted.
Added in version 3.10.
Class Hierarchy¶
Base classes¶
|
|
|
|
The |
|
Base class for map tools that edit vector geometry |
|
Abstract base class for all map tools. Map tools are user interactive tools for manipulating the map canvas. For example map pan and zoom features are implemented as map tools. |
|
Methods
Check if CaptureMode matches layer type. |
|
Called when the feature has been digitized |
|
Called when the feature has been digitized. |
|
Check if CaptureMode matches layer type. |
|
Change the layer edited by the map tool |
Signals
Emitted when the digitizing process was interrupted by the user. |
|
Emitted whenever the digitizing has been successfully completed |
|
Emitted whenever the digitizing has been ended without digitizing any feature |
- class qgis.gui.QgsMapToolDigitizeFeature[source]¶
Bases:
QgsMapToolCaptureLayerGeometry
- __init__(canvas: QgsMapCanvas | None, cadDockWidget: QgsAdvancedDigitizingDockWidget | None, mode: QgsMapToolCapture.CaptureMode = QgsMapToolCapture.CaptureNone)
QgsMapToolDigitizeFeature is a map tool to digitize a feature geometry
- Parameters:
canvas (Optional[QgsMapCanvas]) – the map canvas
cadDockWidget (Optional[QgsAdvancedDigitizingDockWidget]) – widget to setup advanced digitizing parameters
mode (QgsMapToolCapture.CaptureMode = QgsMapToolCapture.CaptureNone) – type of geometry to capture (point/line/polygon),
QgsMapToolCapture
.CaptureNone to autodetect geometry
- checkGeometryType(self) bool [source]¶
Check if CaptureMode matches layer type. Default is
True
.- Return type:
bool
- signal digitizingCanceled[source]¶
Emitted when the digitizing process was interrupted by the user.
Added in version 3.28.
- signal digitizingCompleted(feature: QgsFeature)[source]¶
Emitted whenever the digitizing has been successfully completed
- Parameters:
feature (QgsFeature) – the new digitized feature
- signal digitizingFinished[source]¶
Emitted whenever the digitizing has been ended without digitizing any feature
- featureDigitized(self, feature: QgsFeature)[source]¶
Called when the feature has been digitized
Added in version 3.26.
- Parameters:
feature (QgsFeature)
- layerGeometryCaptured(self, geometry: QgsGeometry)[source]¶
Called when the feature has been digitized.
- Parameters:
geometry (QgsGeometry) – the digitized geometry
- setCheckGeometryType(self, checkGeometryType: bool)[source]¶
Check if CaptureMode matches layer type. Default is
True
.- Parameters:
checkGeometryType (bool)
- setLayer(self, vl: QgsMapLayer | None)[source]¶
Change the layer edited by the map tool
- Parameters:
vl (Optional[QgsMapLayer]) – the layer to be edited by the map tool