In this tutorial, we will guide you step-by-step on how to use the trace tool in QGIS to create a new feature by tracing an existing line segment. This is particularly useful for tasks like extracting topographic profiles from hydrologic networks.
Step 1: Create a New Shapefile
First, we need to create a new shapefile where we will store our traced feature. Follow these steps:
- Go to Layer > Create Layer > New Shapefile Layer in the menu bar.
- In the dialog box, name your shapefile, for example, “topo profile line.”
- Choose Polyline as the geometry type and leave the other settings as default.
- Click OK to create the shapefile.

Step 2: Set Up Toolbars
To use the trace tool, we need to have the correct toolbars displayed:
- Right-click in an empty area of the toolbar to bring up the customization menu.
- Add the Digitizing toolbar to access editing tools.
- Also, add the Snapping toolbar, which contains the trace tool.

Step 3: Configure Snapping Options
Next, we need to configure the snapping options to ensure accurate tracing:
- In the Snapping toolbar, enable snapping by clicking the magnet icon.
- Set it to snap to both vertices and segments of the layer.
- Adjust the snap buffer to a comfortable distance (e.g., 10 pixels).

Step 4: Enable the Trace Tool
Now that we have our toolbars set up, let us activate the trace tool:
- In the Snapping toolbar, click the Enable Tracing button (the icon shows a line being traced). You can also press T to toggle tracing on or off.
- With the Digitizing toolbar visible, click the pencil icon to enter editing mode on your target layer.

Step 5: Start Tracing the Line
We are now ready to trace the existing line. Follow these steps:
- Zoom in on the line you want to trace for better accuracy.
- Click on the starting point of the line to drop a vertex.
- As you move the cursor along the line, left-click to add additional vertices. The trace tool will automatically follow the existing geometry.
- Once you reach the end of the line, right-click to finish the tracing process.

Step 6: Save Your Edits
After completing the tracing:
- Stop editing by clicking the pencil icon again.
- When prompted, save your edits to keep the changes.

FAQ
What is the trace tool used for?
The trace tool in QGIS allows users to create new features by tracing existing lines or shapes, which is useful in various mapping and analysis tasks.
How do I enable tracing in QGIS?
To enable tracing in QGIS, first make sure the Snapping toolbar is visible (right-click the toolbar area and tick Snapping). Then click the Enable Tracing button in the Snapping toolbar, or press the keyboard shortcut T. Tracing only works while you are in editing mode on the active layer and snapping is turned on.
Can the trace tool be used to trace polygons?
Yes. The trace tool works with both line and polygon layers. To trace a polygon boundary, create a new polygon layer, enter editing mode, and use the trace tool to follow the edges of an existing polygon feature. This is a common workflow for digitising land parcels or administrative boundaries from reference data.
Can I adjust the snapping tolerance?
Yes, you can adjust the snapping tolerance in the Snapping toolbar to make it easier or harder to snap to existing features based on your needs.
What should I do if the trace tool is not working correctly?
If the trace tool is not functioning as expected, ensure that the correct layers are active and that the snapping options are properly configured.





