FOSS4G10 - New symbology and legends

Contents

Concepts

First of all, we should bear in mind the difference between the following definitions:

  • Legend : it's the way the geometries are distributed in a layer in order to be drawn depending on some rule like expressions, ranges of an attribute, etc
  • Symbology: it's the specific appearance of a geometry

About exercises

Resources

  • All resources needed by exercises can be found in /data. Specifically, cartography from Andalucia will be used.

Goals

  • Learn to use the symbology manager
  • Learn to design complex symbols

Dot density legend

A dot density legend is going to be applied in this exercise. A number of points proportional with the value of an attribute will be drawn for each polygon.

  • Create a view with CRS EPSG:23030
  • Add the shapefile /data/cartograpy/Andalucia/Provincias andalucia.shp
  • Select the layer in the table of contents(TOC), click right button and select Properties
  • Go to the tab Symbology and select Quantitues --> Dot densities
  • Choose "HABITANTES" as Select field and "100000" as Dot Value (a dot will be drawn for each 100000 HABITANTES)
    Click Apply to see the result witout closing the dialog.
  • Optionally, change the background color and outline

Graduated symbol legend

The graduated symbol legend shows a punctual symbol that will be resized depending on the value of an attribute. Before testing this functionality, we are going to create a composed symbol for points.

First step: creating a composed symbol

  • Load the shapefile /data/cartograpy/Andalucia/puertos_andalucia.shp
  • With right button, select its properties and click on Choose symbol. The symbol manager will be shown. There is a symbol library where symbols can be created and stored.
  • Click on New to create a new symbol
  • There is a stack of symbols that allows you to create a composed symbol
  • We are going to create a symbol composed by three simple symbols. The following table shows the symbol features
    Layer Style Size Color Border
    1 Circle 12 Red Yes
    2 Square 8 Orange No
    3 Cross 4 White No

  • Once the symbol has been created we can store the symbol in the library clicking on the button Save

Second step: using the symbol in the graduated legend

  • Copy and paste in the same view the layers Provincias andalucia.shp
  • Open the properties dialog of the layer clicking with the right button in the TOC
  • Select the symbology tab and choose the Quantities --> Graduated symbols option
  • Set Classification field to "HABITANTES" and Interval type to "Natural intervals"
  • Choose the composed symbol created before as Template
  • Select Size from 5 to 22 pixels
  • Finally select a pale background which will be used for all geometries.

Proportional symbols legend

The proportional symbol legend shows a punctual symbol which is resized depending on the value of an attribute in a proportional way. For example, we have a layer with provinces with the properties area and population. With this legend we can draw a proportional symbol in order to represent the number of citizens per area, that is, the population density

  • Open the layer properties and select Quantities - Proportional symbols in the symbology tab
  • Choose the field "HABITANTES" as Value and "AREA_KM2" as Normalized by
  • Select a punctual symbol, for example the same as the previous exercise.
  • Configure a background with a green pale color filled by lines separated with 9 pixels and 45ยบ slope


Expressions Legend

An expression legend is a classification of geometries using a filter expression on its attributes. Each class will use a different symbol.
Now, we are going to classify a hydrography layer using expressions.

  • Load the shapefile /data/cartograpy/Andalucia/hidro_andalucia.shp
  • Open the layer's properties and go to Categories - Expressions
  • Define two expressions, the first one for elements with [JERARQUIA] > 4 and the secodn one for elements where IsBetween([JERARQUIA],3,4)
  • Optionally define a complex line symbol for the classification
    • For lines with "JERARQUIA" greater than 4 create a line composed by two layers, the interior layer with arrows
    • For lines with "JERARQUIA" between 3 and 4 define a line symbol composed by two lines with an offset and a fill pattern.

Quantities by category legend

It is possible to visualize in a same layer of polygons the combination of two attributes. The first attribute defines the colour of the polygon and the other one is used to define a graduated symbol.
In this example we want to visualize pale green polygons when they have a small area and dark green polygons when they have a big area. On the other hand, we want to visualize symbols with a size depending on the population.

  • Copy and paste in the same view the layers Provincias andalucia.shp
  • Open the properties dialog of the layer clicking with the right button in the TOC
  • Select the symbology tab and choose the Multiple attributes --> Quantities by category option
  • Select "AREA_KM2" as Color field and "HABITANTES" as "Symbol field"
  • Click on Color ramp... and define the intervals for the background color
  • Click on Symbol... and define the intervals for the graduated symbol

Labels