Class: QgsMapToolDigitizeFeature

class qgis.gui.QgsMapToolDigitizeFeature(canvas: QgsMapCanvas, cadDockWidget: QgsAdvancedDigitizingDockWidget, mode: QgsMapToolCapture.CaptureMode = QgsMapToolCapture.CaptureNone)

Bases: QgsMapToolCapture

QgsMapToolDigitizeFeature is a map tool to digitize a feature geometry

Parameters
  • canvas (QgsMapCanvas) – the map canvas

  • cadDockWidget (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

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.

activate(self)
addTopologicalPoints()
addVertex()
cadCanvasReleaseEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

checkGeometryType(self) → bool

Check if CaptureMode matches layer type. Default is true.

New in version 3.0.

Return type

bool

childEvent()
closePolygon()
connectNotify()
createGeometryRubberBand()
createRubberBand()
currentVectorLayer()
customEvent()
deactivate(self)
digitizingCompleted

Emitted whenever the digitizing has been successfully completed

Parameters

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

digitizingFillColor()
digitizingFinished

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

digitizingStrokeColor()
digitizingStrokeWidth()
disconnectNotify()
fetchLayerPoint()
isCapturing()
isSignalConnected()
mapPoint()
nextPoint()
notifyNotEditableLayer()
notifyNotVectorLayer()
points()
pointsZM()
receivers()
sender()
senderSignalIndex()
setAdvancedDigitizingAllowed()
setAutoSnapEnabled()
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

setPoints()
size()
startCapturing()
stopCapturing()
timerEvent()
toCanvasCoordinates()
toLayerCoordinates()
toMapCoordinates()
toMapCoordinatesV2()
undo()