GIS-04 Working with Attributes
5. Working with Attributes
In this exercise, you will focus on the attributes behind vector layers, and how they can be used to style, filter and label your data.
5.1. Attributes for Styling
Go to Layer > Add Layer > Vector Layer and add the wind_turbines_point.shp layer
Right-click > Zoom to layer
Right-click > Open Attribute Table, and have a look at the data
Double-click on the layer, and in the Symbology tab, select Categorized from the dropdown at the top
In the Value field, select STATUS from the dropdown
Click Classify at the bottom of the dialog
Click Apply to see the results
The wind turbine points will be coloured according to their status
To change the colours, double-click on the colour in the Symbol column
Click OK to close the dialog
Expand the wind_turbines_point layer in the Layers panel, and use the checkboxes to turn classes on and off
5.2. Attributes for Labelling
Using the same wind turbines layer you have been working on, double-click to open the Properties dialog again, and click the Labels tab
In the dropdown at the top, select Single Labels
In the Value field, choose an attribute to use as the label - for example STATUS or SITE_ADDRE
Click Apply to see the results
In the Labels dialog, try the options in the list of settings in the middle:
Text: change Font, Style, Size
Buffer: Draw text buffer to make the label stand out from background
Background: Draw background to put a border round the label
When you are happy with the result, click OK to close the dialog
5.3. Filtering with Attributes
Right-click > Filter on the wind turbines layer
In the dialog, under Fields, double-click on YEAR
Under Operators, click > (greater than)
The Expression panel at the bottom will now read
"YEAR" >
After the greater than symbol, type 2016
Click the Test button at the bottom of the dialog - this will show how many features are returned by the filter
Click OK to apply the filter - only those features which meet the filter criteria will now be shown