QGIS – Raster Tracer

Marketing
Marketing
  • Updated

by David Crowther

DC_Raster_Tracer_1.png

Question:

Is it possible to trace features from a Raster Image Tile?

Answer:

Tracing existing vector features is a common task in QGIS and enables you to more accurately digitise your features from existing geometry. However, sometimes the features that you wish to trace haven’t been digitised and only exist in raster basemaps.

Well, using the QGIS Raster Tracer Plugin you can also easily trace around basemap features to create the content that you need.

From the Plugins menu > choose Manage and Install Plugins and then search for ‘raster tracer’. Choose the Raster Tracer plugin and install this into your QGIS.

DC_Raster_Tracer_2.jpg

The Raster Tracer plugin will then be available as a new button on the Raster Tracer toolbar.

DC_Raster_Tracer_3.jpg

DC_Raster_Tracer_4.jpg

Open the Raster Layer to trace against – in this case a Site Plan Raster image.

DC_Raster_Tracer_5.jpg

Open or create a new vector layer to use for tracing – in this case I am using a layer called Boundary.

Make the Layer editable,…

DC_Raster_Tracer_6.jpg

and then choose the Raster Tracer icon.

DC_Raster_Tracer_7.jpg

In the Raster Tracer Panel choose the Raster Layer to Trace against – Site Plan.

DC_Raster_Tracer_8.jpg

then choose the Trace Colour, by selecting Pick Colour from the options.

DC_Raster_Tracer_9.jpg

then click in the map on the feature that you wish to trace, so that it can Pick the Trace Colour. In this instance we will click on a pixel that is coloured Red as per the Site Boundary feature.

DC_Raster_Tracer_10.jpg

Once you have selected the Trace Colour, you can now left click on that feature in the map to start digitising.

Then simply left click on parts of that feature and the Raster Tracer will trace between the last and next click selecting the pixels between that are the same as the chosen colour.

DC_Raster_Tracer_11.jpg

Continue tracing by moving the map and left clicking on that feature at various points along the boundary, and see how the traced line behind you is coloured blue.

DC_Raster_Tracer_12.jpg

DC_Raster_Tracer_13.jpg

Finally when you are at the end point, left click to add the last trace point in and then right click to finish the line.

DC_Raster_Tracer_14.jpg

The Traced line around the Site Boundary will now be drawn as a vector object on top of the Raster Site Plan.

DC_Raster_Tracer_15.jpg

However, you will see that the Traced line will likely be very jagged, as it has picked lots of pixels to trace.

DC_Raster_Tracer_16.jpg

To resolve this you can run a post processing routine to Simplify the line and remove the numerous vertices that make the line jagged.

From the Vector menu choose > Geometry > Simplify…..

DC_Raster_Tracer_17.jpg

The output file will now be a more Simplified version of the original traced line. Here you can run the Simplified routine a few times, choosing a different Tolerance, to remove more or less vertices so that the Simplified line is smoother but still retains the original shape.

DC_Raster_Tracer_18.jpg

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.