by David Crowther
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.
The Raster Tracer plugin will then be available as a new button on the Raster Tracer toolbar.
Open the Raster Layer to trace against – in this case a Site Plan Raster image.
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,…
and then choose the Raster Tracer icon.
In the Raster Tracer Panel choose the Raster Layer to Trace against – Site Plan.
then choose the Trace Colour, by selecting Pick Colour from the options.
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.
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.
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.
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.
The Traced line around the Site Boundary will now be drawn as a vector object on top of the Raster Site Plan.
However, you will see that the Traced line will likely be very jagged, as it has picked lots of pixels to trace.
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…..
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.
Comments (0 comments)