Raster Analysis in Context

“Raster analysis are operations performed to alter the cell values of the raw data. The output are a result of computations on a cell-by-cell basis. The value of the output for one cell is usually ind”

In this module, we explore the raster operations namely zonal operations. We explore how zonal analysis can be achieved in QGIS.

You try:

Goal: You are a disaster manager in your region and you are required to produce a map which shows the population density of each administrative area.

Data: appendix3-local-data - kzn_pop_count.tif,districts.shp

  • Load the layers into a new project
  • Project the vector and raster to the specified CRS and remove the initial layers loaded.
  • Symbolise the projected layers
  • Calculate the zonal statistics of each
  • Change the transparency of the above result layer to 70. Move it to the top of the raster layer.
  • Toggle the distict layer so that it does not render
  • Toggle edit distict_projected and use field calculator to create a column density with the values given on the table.
  • Enter the formulae for density to populate the density column
  • Label the density_projected layer with the calculated density.
  • Create a map to show your results

Name Expectation


appendix3-local-data - kzn_pop_count.tif,districts.shp



Spatial algorithm

Zonal Statistics

Column attribute

density,Decimal size 10,precision 6

More about

Raster operations are grouped into three types:

  • Local Operations
  • Zonal Operations
  • Neighbourhood Operation

Raster operations are cell by cell computations. Zonal operations work within groups of cells. The zones may be contiguous or non-contiguous. Contiguous zones include cells that are spatially connected, whilst a non-contiguous zone includes separate regions of cells. When undertaking zonal operations the zones can be defined as a raster or vector. When using a raster as a zone all the cells with the same value would define the zone and for polygons all the features with the same attribute.

Zonal operations can be done on single raster or multi rasters. An example of a zone can be a census district and the zonal statistics cane counting the number of streams that occur in each census district.

Check your knowledge:

  1. What is population density and how is it calculated:
    1. Population Density is the number of organisms per unit volume
    2. Population Density = Number of People/Land Area
    3. Population density is a type of GIS operation available in QGIS
  2. What is the difference between EPSG:4326 and EPSG:3857:
    1. There just fancy numbers used to make GIS difficult.
    2. EPSG:4326 is the projection that is true for the whole world.
    3. EPSG:4326 define latitude and longitude projections whilst EPSG:3857 represent data in metres.
  3. If a user does not have a polygon with zones he/she cannot compute zonal statistics:
    1. True
    2. False