Raster calculator in Context

“Raster consists of pixels which are organised in rows and columns. Each pixel has got a values which represents a specific phenomenon on the earth surface. Because raster are based on pixel we can do ”

In this module, we will look at how raster can be manipulated by using arithmetic operation. Raster data is very useful as it gives us information over a large scale and we can then derive new datasets from these. Let's dig in and explore the raster calculator.

You try:

Goal: To learn how to reclassify raster pixel values into 2 or 3 categories with raster calculator.

Check your results:

Produce a reclassified raster with 2 or 3 classes and total area of each class.

  • Load the data.
    *Load the min/max values of the raster.
  • Use the raster calculator to create a binary raster where all pixels < 200 are reclassified to 1 and pixels > 200 are reclassified to 0
  • Symbolize the binary raster using the parameters defined in raster style
  • Reclassify the original raster to 3 classes with the following pixel ranges (Pixel_value < 200 = 0
    Pixel_value > 200 and < 1000 = 1
    Pixel_value >1000 = 2)
    Hint: Use the recode expression?
  • Symbolise the result to show three distinct classes.

To Do: Calculate the area of each class

Name Expectation

Raster Layer





("[email protected]" < 200) * 1

Raster style

Single band pseudocolour, Equal interval and two classes



More about

Raster analysis enforces its spatial relationships based on the location of the cell. Raster operations performed on multiple input raster datasets generally output cell
values that are the result of computations on a cell-by-cell basis. The value of the output for one cell is usually independent of the value or location of other input or output cells. In some cases, output cell values are influenced by neighbouring cells or groups of cells, such as in focal functions. There are mainly three types of raster analysis operations namely local, focal and zonal.

Raster calculator provides a means to do cell by cell analysis by using arithmetic operations and mathematical formulae to compute new outputs. Raster calculator functions mainly fall into the local operations category. These constitute the bulk of the analysis techniques that occur for rasters. The cell values of the new raster are computed by a function relating the input to output or are assigned by a classification table.

Check your knowledge:

  1. Do neighbourhood operations work on single rasters only:
    1. Yes
    2. No
  2. Which of these datasets can we apply arithmetic operations on:
    1. A GIS raster dataset where each pixel represents the depth of a flood
    2. A GIS vector dataset where each polygon represents an area of high, medium or low flood depth
    3. A GIS vector dataset where each polygon represents a building with high, medium or low occupancy rate
  3. Raster calculator can be used with Digital elevation models:
    1. True
    2. False