Version 2.2.0 (unreleased) | Last Updated: 2026-11-29
Feature and workflow guide for the Freehand Digitize QGIS plugin. For a quick start see README.md; for the design see ARCHITECTURE_EN.md.
Freehand Digitize lets you draw lines and polygons by dragging the mouse over the map. On release, the stroke becomes a feature in the active vector layer.
It restores the feature set of the classic freehandEditing plugin:
Ctrl snapping of the first and last vertex;The UI is available in English (source language), Spanish, Portuguese (Brazil), French, German, Italian and Indonesian. This guide uses the short English action names shown in the tooltips: Add, Reshape, Difference/cut, Clip, Split, Sampling and Help.
dist/freehand_digitize.<version>.zip.uv run qgis-manage deploy --no-compile --qgis-version 4
Alternatively, copy the plugin folder to
~/.local/share/QGIS/QGIS4/profiles/default/python/plugins/freehand_digitize.
After installation, the action appears in the Digitize toolbar and in Vector → Freehand Digitize.
A polygon is closed automatically: you only need three distinct points, and the first point is repeated to build the ring. A line needs at least two points.
The reshape action modifies existing geometries instead of creating new ones:
Ctrl+Z restores every
reshaped feature.If a selection exists, only selected features that also intersect the stroke are
reshaped. A warning is shown when the stroke crosses no feature or when no
candidate could be reshaped. Esc cancels the stroke, and Ctrl snapping works
on the first and last vertex exactly as in the creation tool.
The difference action subtracts one existing feature from another:
target − cutter; the cutter is not
modified. One Ctrl+Z restores the target.The target keeps its attributes. If the result is empty (the cutter covers it) or invalid, the target is left unchanged and a warning is shown. This is a difference, not a split: the result remains one feature, possibly multipart. Cross-layer difference is not supported in this version.
Clip and split use the same target/cutter and selection rules; see Clip, split and live measurements.
Select two features, or click the target and then the cutter, and choose Clip. The target is replaced by its intersection with the cutter; the cutter is not modified. The result must keep the layer geometry type.
Select exactly one line or polygon, activate Split, and draw a stroke across it. The original attributes are copied to the new parts and the operation is one undo command.
While drawing, a small overlay shows the current length (line) or area (polygon). It is hidden when the stroke finishes or is cancelled and does not change the stored geometry.
The plugin uses the QGIS Digitize toolbar. The action order is:
Add → Reshape → Difference/cut → Clip → Split → Sampling → Tolerance → Help
| Icon | Action | Behaviour |
|---|---|---|
| Add | Draw a new line or polygon. | |
| Reshape | Reshape existing features under a stroke. | |
| Difference/cut | Subtract the cutter from the target. | |
| Clip | Keep the target ∩ cutter. | |
| Split | Split one selected feature with a stroke. | |
| Sampling | Configure pixel or layer-unit vertex spacing. | |
| Tolerance | Simplification tolerance in layer units (spin box). | |
| Help | Open the bundled offline user guide. |
Tooltips start with the action name, for example Add — … or
Difference/cut — …. Icons have light and dark variants and follow the active
QGIS theme.
The tolerance spin box sits next to the actions.
| Control | Behaviour |
|---|---|
Tolerance (0.000–5.000) |
Simplification tolerance in layer units. 0 disables simplification. |
| Decimals / step | 3 decimals, step 0.1. |
| Persistence | The value is stored in QGIS settings (freehand_digitize/tolerance). |
| Legacy migration | The old freehandEdit/tolerance value is imported on first use. |
| Geographic CRS | The spin box is disabled and the effective tolerance is 0. |
The simplification is applied before the feature is validated and inserted. If the simplified geometry is empty, the original stroke is kept.
The Sampling action controls how many vertices are captured:
Defaults are 1.5 px and 0.5 layer units. The layer-unit default becomes 0.0001° when the active layer uses a geographic CRS. Each unit keeps its own distance.
Geographic CRS warning: in a geographic layer, layer units are degrees. One degree of longitude is not a constant length (it shrinks with latitude), so layer-unit sampling is not a uniform ground distance. Use pixels for a uniform on-screen density or a projected CRS for metric sampling.
The edit-session rule applies to the map tools, not to this dialog: sampling can be configured even when no layer is being edited.
Hold Ctrl when you press the mouse button to snap the first vertex, and keep it held when you release to snap the last vertex.
The plugin uses the QGIS snapping engine:
snapToCurrentLayer, vertex type);snapToMap);Snapping respects the QGIS snapping configuration (mode, tolerance and enabled layers). If snapping is disabled or the tolerance is too small, no vertex is snapped and the stroke starts/ends at the pointer.
This is an improvement over the original plugin, which only snapped the first point.
When QGIS is configured to enter attribute values after digitizing, the attribute form opens before the feature is added.
Provider default values, expressions and constraints are applied through
QgsVectorLayerUtils.createFeature, so required fields and defaults behave like
the standard QGIS digitizing tools.
While the form is open, canvas clicks are ignored so a stray click cannot start a new stroke.
| Situation | Result |
|---|---|
| Feature created | One undo command; Ctrl+Z removes the feature. |
| Form cancelled | No feature and no empty undo command. |
| Layer rejects the feature | The command is destroyed and a warning is shown. |
| Invalid geometry | A dialog asks whether to use it anyway. |
Stroke cancelled with Esc |
The rubber band is cleared; the tool stays active. |
The invalid-geometry dialog is intentional: the plugin does not silently call
makeValid(). Choose No to abandon the feature and redraw the stroke.
The stroke is recorded with toLayerCoordinates, so the geometry is created in
the layer CRS, not in the project CRS. This is safe when the layer and the
project use different CRSs (on-the-fly reprojection).
The tolerance is expressed in layer units. For a geographic CRS (degrees),
the spin box is disabled and 0 is used because a degree-based tolerance would
be meaningless.
| Input | Action |
|---|---|
| Left button + drag | Draw the stroke. |
| Release left button | Finish and create the feature. |
| Release secondary/middle button | Finish the stroke early (halt the drag). |
Ctrl at press |
Snap the first vertex. |
Ctrl at release |
Snap the last vertex. |
Esc with a stroke |
Cancel the stroke, keep the tool active. |
Esc with no stroke |
Deactivate the tool. |
| Symptom | Cause / fix |
|---|---|
| The action is disabled | The active layer is not a line/polygon layer in edit mode. Select one and start editing. |
| “Select the layer where you want to draw first.” | No active layer. Select the target layer first. |
| “This tool only draws on line or polygon layers.” | Point layers are not supported. |
| “Start editing layer ‘…’ before drawing.” | Activate edit mode on the layer; the plugin no longer starts it automatically. |
| The tolerance spin box is disabled | The layer uses a geographic CRS; tolerance is forced to 0. |
| The attribute form does not open | QGIS is configured to skip the form, or the layer has no editable fields. |
| The feature is not where expected | Check the layer CRS and that you used the layer, not the project, as the target. |
Ctrl does not snap |
QGIS snapping is disabled, no target is within tolerance, or the snapping mode excludes the layer. |
Technical messages are written to the QGIS message log with the Freehand Digitize tag. Open View → Panels → Log Messages to inspect them.
Use the Help button in the Freehand Digitize toolbar, or Help → Plugins → Freehand Digitize user guide. QGIS opens the bundled offline guide; if it is missing, the GitHub guide opens instead.
freehandEditing project is
credited as the origin.