6.9.6. Conditional expressions using the raster calculator
To statistically analyse the area covered by three land cover types of interest (arable land, coniferous, and mixed forest) within the 2 km buffers (created in section 18.104.22.168.), we will first create three new raster layers using raster calculator.
- Open the Raster calculator (Spatial Analyst Tools > Map Algebra > Raster calculator).
- Combine Layers and Variables and functions until the Raster calculator expression equals “Con("g100_06_ch_FR.tif" == 12, 1, 0)” (Fig. 53) (12 is the raster value for “Non-irrigated arable land” in the CLC06 dataset). The expression is a conditional statement (Con) which literally means: if the value of a pixel from the g100_06_ch_FR.tif layer equals 12, assign that pixel a new value of 1. If not, assign a value of 0. This will create a binary raster.
- Specify an output raster, e.g. lc_class211.tif, which denotes that the new layer will represent the 211 (Non-irrigated arable land) land cover code.
- Click OK.
steps 45 to 48 with the following raster values: 24 (replaces 12 in the
equation in step 46.) (class 312 as the output, Coniferous forest) and 25
(class 313, Mixed forest).
created raster images contain zones with the value 1 (where the Raster calculator expression was true,
i.e. the land cover represents the non-irrigated arable land category) and 0,
where the expression was false (i.e. the land cover does not represent the
non-irrigated arable land category).
Fig. 53. The Raster Calculator dialog box showing the equation used to select all of the land cover code 211 from the entire raster.