Class: QgsMapToolDigitizeFeature

class qgis.gui.QgsMapToolDigitizeFeature

Bases: QgsMapToolCapture

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.

New in version 3.10.

QgsMapToolDigitizeFeature(canvas: QgsMapCanvas, cadDockWidget: QgsAdvancedDigitizingDockWidget, mode: QgsMapToolCapture.CaptureMode = QgsMapToolCapture.CaptureNone) QgsMapToolDigitizeFeature is a map tool to digitize a feature geometry

Parameters
activate(self)
addTopologicalPoints(self, vertices: Iterable[QgsPointXY]) QgsMapToolEdit.TopologicalResult

Adds a list of vertices to other features to keep topology up to date, e.g. to neighbouring polygons. The vertices list specifies a set of topological points to add, in the layer’s coordinate reference system.

Deprecated since version QGIS: 3.12 - will be removed in QGIS 4.0. Use the variant which accepts QgsPoint objects instead of QgsPointXY.

addTopologicalPoints(self, vertices: Iterable[QgsPoint]) -> QgsMapToolEdit.TopologicalResult Adds a list of vertices to other features to keep topology up to date, e.g. to neighbouring polygons. The vertices list specifies a set of topological points to add, in the layer’s coordinate reference system.

New in version 3.10.

cadCanvasReleaseEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

capabilities(self) QgsMapToolCapture.Capabilities
Return type

QgsMapToolCapture.Capabilities

checkGeometryType(self) bool

Check if CaptureMode matches layer type. Default is True.

New in version 3.0.

Return type

bool

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deactivate(self)
digitizingCompleted

Emitted whenever the digitizing has been successfully completed

Parameters

feature (QgsFeature) – the new digitized feature [signal]

digitizingFinished

Emitted whenever the digitizing has been ended without digitizing any feature [signal]

disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
notifyNotEditableLayer(self)

Display a timed message bar noting the active vector layer is not editable.

notifyNotVectorLayer(self)

Display a timed message bar noting the active layer is not vector.

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setCheckGeometryType(self, checkGeometryType: bool)

Check if CaptureMode matches layer type. Default is True.

New in version 3.0.

Parameters

checkGeometryType (bool) –

setLayer(self, vl: QgsMapLayer)

Change the layer edited by the map tool

Parameters

vl (QgsMapLayer) – the layer to be edited by the map tool

stopCapturing(self)

Stop capturing

supportsTechnique(self, technique: QgsMapToolCapture.CaptureTechnique) bool
Parameters

technique (QgsMapToolCapture.CaptureTechnique) –

Return type

bool

timerEvent(self, QTimerEvent)