Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post

How to Use the Trace Tool in QGIS

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:

  1. Go to Layer > Create Layer > New Shapefile Layer in the menu bar.
  2. In the dialog box, name your shapefile, for example, “topo profile line.”
  3. Choose Polyline as the geometry type and leave the other settings as default.
  4. Click OK to create the shapefile.

Creating a new shapefile in QGIS

Step 2: Set Up Toolbars

To use the trace tool, we need to have the correct toolbars displayed:

  1. Right-click in an empty area of the toolbar to bring up the customization menu.
  2. Add the Digitizing toolbar to access editing tools.
  3. Also, add the Snapping toolbar, which contains the trace tool.

Adding toolbars in QGIS

Step 3: Configure Snapping Options

Next, we need to configure the snapping options to ensure accurate tracing:

  1. In the Snapping toolbar, enable snapping by clicking the magnet icon.
  2. Set it to snap to both vertices and segments of the layer.
  3. Adjust the snap buffer to a comfortable distance (e.g., 10 pixels).

Configuring snapping options in QGIS

Step 4: Enable the Trace Tool

Now that we have our toolbars set up, let us activate the trace tool:

  1. 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.
  2. With the Digitizing toolbar visible, click the pencil icon to enter editing mode on your target layer.

Enabling the trace tool in QGIS

Step 5: Start Tracing the Line

We are now ready to trace the existing line. Follow these steps:

  1. Zoom in on the line you want to trace for better accuracy.
  2. Click on the starting point of the line to drop a vertex.
  3. As you move the cursor along the line, left-click to add additional vertices. The trace tool will automatically follow the existing geometry.
  4. Once you reach the end of the line, right-click to finish the tracing process.

Tracing a line in QGIS

Step 6: Save Your Edits

After completing the tracing:

  1. Stop editing by clicking the pencil icon again.
  2. When prompted, save your edits to keep the changes.

Saving edits in QGIS

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.

About the Author
I'm Daniel O'Donohue, the voice and creator behind The MapScaping Podcast ( A podcast for the geospatial community ). With a professional background as a geospatial specialist, I've spent years harnessing the power of spatial to unravel the complexities of our world, one layer at a time.