1.3. Area operations for descriptive statistics

1.3.1. Introduction

Area operations compute a new value for each cell as a function of existing cell values of cells associated with an area containing that cell. The area operations are like point operations to the extent that they compute new cell values on basis of one or more map layers. Unlike point operations, however, each cell value is determined on the basis of the several cell values in the zone containing the cell under consideration. In most cases the operation represents a descriptive statistics calculation, for instance the mean value over each area.

1.3.2. Calculation of statistics of an area

For calculation of a map that contains for each soil class the average elevation in the soil class, the areaaverage operator is used. Try:

soiltopoMap = areaaverage(topoMap, soilsMap) <Enter>

Display soiltopoMap, topoMap and soilsMap.


Question: What is calcualated by the areaaverage operation in this case?

  1. The operation assigns to each cell the average elevation value of cells in a map that belong to the same area (class on soilsMap) as the cell itself.

  2. The operation assigns the area of the area (class on soilsMap) to which the cell belongs to the cell itself.

  3. It gives an average idea of the distribution of the elevation in the soil classes.

Correct answers: a.

Feedback: None


For assigning the area of the soil class to which each cell belongs, the areaarea operator can be applied. Try:

soilareaMap = areaarea(soilsMap) <Enter>

Display soilareaMap and the soilsMap.


Question: What is name or cell code of the soil class that covers the largest area in the study area?

  1. Gravel, with cell code 8.

  2. Sand, with cell code 9.

  3. Boulder clay, with cell code 10.

Correct answers: c.

Feedback: None


1.3.3. Finding contiguous areas; a study problem

The pine forests in this area are partly used for commercial logging. One of the constraints to evaluate whether a certain patch of pine trees will produce enough yield to create some profit when logged, is the size of the patch. Logging of pine trees is economically feasible only for patches (contiguous areas) with pines that are larger than 4 hectares. The goal of this question is to create a boolean map that has TRUE cell values for patches with pine that are feasible for logging and a boolean FALSE cell values for the remaining area.

Display treesMap.

If you cannot see the codes, it has the following cell codes:

  • open, code 0

  • pine, code 1

  • deciduous, code 2

  • mixed wood, code 3

Create a boolean map (call it pineMap) that contains a 1 (TRUE) for cells with pines and a 0 (FALSE) for cells without pines. Use the treesMap in an operation with ==. Display the map you just created, pineMap.

To be able to determine the size of each of the individual patches of pine-trees a separation in contiguous areas on pineMap has to be made. This is done with the clump operator. It groups in a boolean, nominal or ordinal map all those cells that have the same class-value and neighbour each other. Have a look at the PCRaster manual page for clump to get more information.

Every group (‘clump’) of cells satisfying these conditions is assigned a new class-value in the resulting map. Type:

pineclumMap = clump(pineMap) <Enter>

And display pineMap and pineclumMap.

Now, calculate a map (call it pineareaMap) that contains for each clump on pineclumMap the area of the clump under consideration. Use the areaarea operator. Display the pineareaMap together with pineMap by typing:

aguila(pineareaMap,pineMap) <Enter>

Note that the maximum value in the legend of pineareaMap is the large area without pine trees (which is also calculated by areaarea). As a result, some patches are hidden by this somewhat unpractical scale of the legend of pineareaMap. To get the areas of the patches of pine trees, click with the mouse on pineMap and read the values on pineareaMap from the data view.

You can change the cell values in the area without pine trees to 0 with the ifthenelse operator. Type:

pineare2Map = ifthenelse(pineMap, pineareaMap, 0) <Enter>

Display pineMap and pineare2Map and use the mouse.


Question: What is the data type of pineare2Map?

  1. Nominal

  2. Ordinal

  3. Boolean

  4. Scalar

Correct answers: d.

Feedback: It gives the area, which is a continuous (floating point) value, so it has a scalar data type.


Now you can find the answer to the study problem. Use the pineare2Map to find contiguous areas with pines that are larger than 4 hectares. Use the > operator in an operation with pinare2Map. Note that each cell is 50 x 50 m2.


Question: How many contiguous patches (clumps) exist greater than 4 hectares?

  1. 1

  2. 2

  3. 8

  4. 7

Correct answers: b.

Feedback:

pineMap = treesMap == 1
pineclumMap = clump(pineMap)
pineareaMap = areaarea(pineclumMap)
pineare2Map = ifthenelse(pineMap, pineareaMap, 0)
contMap = pineare2Map > (4 * 100 * 100)