Vector Masks

This tutorial shows two ways to use a vector layer to highlight an area of an underlying layer.


For the simple method, we take a vector shape, set a combination of fill colour, pattern and transparency to highlight an area.

We will use a background raster (1:25k) and a mask created from a parish boundary originally in an OS Boundary Line shapefile. If you don’t have access to this layer, use any other simple or virtual raster as a background.

Next load the parish_region vector layer. You can find it in either of the following locations:





Ordnance Survey


252 MB

This contains a number of different UK boundary lines.


Parish Boundary

58 MB

Just the files associated with the parish council boundaries. Copy all files into the same directory.

Select just the parish of Dauntsey

Parish boundaries are available as shapefiles (vector layer) in the OpenData Boundary-Line (called parish_region) or in the parish boundary file above.

Load this layer - you will get all the parishes in the country, so we need to select a single one to work with.

Open the layer’s attribute table (right-click on the layer and select Open attribute table).

In the Look for area type Dauntsey (or whatever you want to search for), select Name from the drop-down list in then click Search.

If the selected feature happened to be in the visible part of the map window it will have changed to yellow - selected. Select the Show selected only and you should only have your feature selected. If you make a mistake and need to start over, uncheck Show selected only and click the button immediately above it(Unselect all) then try again.

With the single feature selected (you could do this with multiple features, but we only need one for now), close the dialog.

Save to a new shapefile

Right-click and the layer and select Save selection as... and then save as a shapefile called Dauntsey CP.

Right-click on the layer again and select Remove as we’ve finished with it. Add the new Dauntsey CP layer. It will load as a solid filled shape in a random colour.


Style the new layer

There are a number of different things we can do, depending on how we wish to show Dauntsey.

Solid background with name.

Select the layer properties Labels tab, check Display Labels and Name for Field containing label.

Click Apply whenever you want to see how it looks. Check Buffer labels and experiment with different buffer sizes and colours.

Change the font size from In points to In map units. You will probably need to change the font size to about 300 as Ordnance Survey map units are metres so you are setting a font height to 300 metres.

Try different settings of the transparency slider. This controls the transparency of the fill, but not any labels that you have enabled.


Textured background
(with or without name).

Still with the Style tab, try different settings for Fill options.


New symbology.

A completely new symbology is under development and due to replace the “old” symbology when QGIS moves to version 2. While this isn’t fully complete, it already introduces certain features not available with old symbology.

New symbology needs a whole set of tutorials to do it justice, but here is a taster.

Still with the Style tab, select New Symbology try different settings for Fill options.




This method extracts a feature from a vector layer and uses it to create a mask. The mask in turn is used to highlight an area as shown below.

The image uses a background raster (1:25k) and a mask created from a parish boundary originally in an OS Boundary Line shapefile.

The parish boundary is used to create a parish shaped hole in a simple rectangle as a new vector layer. This layer is then styled to have a light grey fill with a transparency level to show a faded view of the map outside the parish.

The final stage is to add a final vector layer to provide the coloured parish boundary and the parish name.

Create a rectangular shape greater than the maximum visible extent.

Combine with the Dauntsey outline using Vector->Geoprocessing Tools->Difference to create a rectangle with a Dauntsey shaped hole.

Set the layer fill colour and transparency.

Overlay with suitably styled Dauntsey parish boundary.


Information on this site is copyright Dauntsey Parish Council Drainage Board. Most of the maps are based on Ordnance Survey OpenData and additionally covered by that licence.

Home QGIS Contact Us