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

  1. Go to Layer > Add Layer > Vector Layer and add the wind_turbines_point.shp layer

  2. Right-click > Zoom to layer

  3. Right-click > Open Attribute Table, and have a look at the data

  4. Double-click on the layer, and in the Symbology tab, select Categorized from the dropdown at the top

  5. In the Value field, select STATUS from the dropdown

  6. Click Classify at the bottom of the dialog

  7. Click Apply to see the results

  8. The wind turbine points will be coloured according to their status

  9. To change the colours, double-click on the colour in the Symbol column

  10. Click OK to close the dialog

  11. 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

  1. Using the same wind turbines layer you have been working on, double-click to open the Properties dialog again, and click the Labels tab

  2. In the dropdown at the top, select Single Labels

  3. In the Value field, choose an attribute to use as the label - for example STATUS or SITE_ADDRE

  4. Click Apply to see the results

  5. In the Labels dialog, try the options in the list of settings in the middle:

    1. Text: change Font, Style, Size

    2. Buffer: Draw text buffer to make the label stand out from background

    3. Background: Draw background to put a border round the label

  6. When you are happy with the result, click OK to close the dialog

5.3. Filtering with Attributes

  1. Right-click > Filter on the wind turbines layer

  2. In the dialog, under Fields, double-click on YEAR

  3. Under Operators, click > (greater than)

  4. The Expression panel at the bottom will now read
    "YEAR" >

  5. After the greater than symbol, type 2016

  6. Click the Test button at the bottom of the dialog - this will show how many features are returned by the filter

  7. Click OK to apply the filter - only those features which meet the filter criteria will now be shown