Keywords

1 Spatial Metrics

Description

Spatial metrics are a set of indices or metrics that were first developed within the field of landscape ecology (Forman 1995), which is why they are often referred to as landscape metrics. Landscape metrics were designed to quantitatively characterize the pattern of a landscape, and its relationship with landscape processes. Nowadays, they are also widely used to characterize the pattern of categorical maps. When used for this purpose, they are generally referred to as spatial metrics (Herold et al. 2005).

Spatial metrics were initially developed for raster data, although some of them have also been adapted for calculation with vector data, for which the polygon is the unit of measurement. For raster data, the reference concept for calculating the metrics is the patch.

A patch is defined as a contiguous area of pixels belonging to the same category. The number and shape of the patches in a raster will depend on the neighbourhood rule applied (Fig. 1). Under the 4-cell neighbourhood rule, two pixels with the same value are considered to belong to the same patch if one is immediately above, below or adjacent to another pixel. An 8-cell neighbourhood will also consider pixels that are diagonal to each other as part of the same patch.

Fig. 1
figure 1

Examples of patch delineation according to 4-cell and 8-cell neighbourhood rules for an example landscape

Spatial metrics can be calculated at three different levels: per patch, per category or for the whole map (landscape level). In the first case, each metric is calculated for every single patch. In the second case, the metrics are calculated for all the patches belonging to every single category on the map. In the last case, the metrics are calculated for the map as a whole. Not all metrics can be calculated for the three levels of analysis, but some of them are only available for certain levels of analysis.

There is a wide variety of metrics available, and new ones are regularly being proposed (Botequilha Leitao et al. 2006; Jaeger 2000; Mcgarigal 2018). Most of them are closely correlated. This means that despite the wide number of metrics available, many of them provide the same or very similar information.

Spatial metrics are usually classified into groups according to the information they provide: area, density and edge metrics; shape metrics; connectivity metrics and diversity metrics. The first group (area, density and edge) provides information about the area and perimeter of the patches. Shape metrics assess the complexity of the shape of the patches, based on their area and perimeter, while connectivity metrics quantify the degree to which patches relate to each other (how connected they are) and are usually calculated at the category level. Finally, diversity metrics quantify the heterogeneity of the map and can only be computed at a landscape level.

For an overview of the range of metrics available and a description, please see Botequilha Leitao et al. 2006, Jaeger 2000; Mcgarigal 2018.

Utility

Exercises

1. To validate a map against reference data / map

2. To validate a simulation against a reference map

3. To validate simulated changes against a reference map of changes

4. To validate a series of maps with two or more time points

5. To validate a series of maps with two or more time points (vector)

6. To validate a series of maps with two or more time points (raster)

Spatial metrics are some of the most popular tools for analysing the pattern of categorical maps. Using the wide diversity of spatial metrics currently available, we can obtain numerous quantitative measurements of the fragmentation, shape complexity and heterogeneity of the landscape.

Spatial metrics can be calculated for the whole map or for certain specific features. In the case of Land Use Cover Change analyses, including LUCC modelling, spatial metrics can be specifically used to characterize the pattern of the elements that change.

Spatial metrics are usually highly dependent on the scale of analysis (Šímová and Gdulová 2012). Scale refers not only to the cartographic scale at which the map was drawn but also to its spatial and thematic resolutions. This makes them useful for evaluating the impact of changes in the scale on the way a landscape is represented on a map. They can also be used to assess the impact of resampling categorical maps. However, this also makes them very uncertain tools when comparing two or more maps that have different resolutions or were obtained at different scales. In these cases, the results must be treated with caution.

For maps at the same scale, spatial metrics can be used to assess to what extent their patterns differ. In other words, they assess the relative complexity of their shapes and perimeters, the degree to which they are fragmented, or how close patches belonging to the same categories are to each other.

QGIS Exercise

As mentioned earlier, there are a lot of spatial metrics available, many of which are highly correlated. Despite this, there is a wide range of different metrics that characterize map patterns in different ways.

It would be impossible to present example exercises for all the available spatial metrics in the literature, as there would be enough material to fill an entire book. This is why, in the exercises proposed here, we focus on the metrics most commonly used for validating maps or analysing their uncertainties. These metrics are also suitable for many other exercises that users may typically wish to perform. However, they should be aware that other metrics are available which may be more suitable or useful in certain specific cases.

Available tools

• Raster

     Landscape ecology

        Landscape statistics

        Landscape vector overlay

• Processing toolbox

     LecoS

        Landscape modifications

          Neighbourhood Analysis (Moving Window)

       Landscape statistics

         Count raster cells

         Landscape-wide statistics

         Patch statistics

         Zonal statistics

        Landscape vector overlay

         Overlay raster metrics (Polygon)

• Processing toolbox

     SAGA

        Raster analysis

          Pattern analysis

• Processing toolbox

     SAGA

        Vector polygon tools

          Polygon shape indices

Despite the widespread use of spatial metrics, QGIS offers few tools for calculating them. For vector maps, we have the Polygon shape indices tool, which characterizes the area, perimeter and shape compactness of polygons. Metrics are calculated for each polygon, i.e. at patch level.

Of the tools available for raster maps, we highlight two: the LecoS plugin (Jung 2016) and the SAGA “Pattern analysis” tool. GRASS also provides a suite of tools for calculating spatial metrics: r.li tools. However, there are certain problems with their integration in the QGIS environment that prevent their normal use. This is why we have not considered them as an option for calculating spatial metrics in this book.

The SAGA tool only allows the user to calculate a few metrics (relative richness, diversity, dominance, fragmentation, number of different classes, centre versus neighbours), although these are not amongst the most frequently used when comparing map patterns. These metrics can only be calculated for the entire landscape or study area and are not available at patch or class level. In addition, although the user may select the window at which the spatial metrics are calculated (3 × 3, 5 × 5 or 7 × 7), the 8-cell neighbourhood rule is applied by default and cannot be changed.

The “LecoS” plugin offers a wider set of metrics and two levels of analysis: per class and for the entire map. It also provides a few extra tools with which to manipulate the maps and extract specific elements that may be of interest to users. The plugin also allows us to calculate the metrics for specific areas of the map that overlay a vector layer defined by the user. Nonetheless, these spatial metrics cannot be calculated per patch and the 8-cell neighbourhood used by default for the calculation cannot be changed. For full information about the plugin and the various possibilities it offers, readers should consult the Lecos website and the paper by Jung (2016).

The R package “landscapemetrics”Footnote 1 provides almost all the options currently available for calculating spatial metrics (Hesselbarth et al. 2019). It supplies many more metrics than the “LecoS” plugin, allows the user to select the neighbourhood rule and includes the three levels of analysis (patch, category or whole landscape). R offers the full workflow available through FRAGSTATS (McGarigal, 2015),Footnote 2 a free, very user-friendly software, which is widely regarded as the software of reference for calculating spatial metrics.

Although the R package offers us all the options currently available for calculating spatial metrics, in this chapter we will be focusing exclusively on the LecoS plugin. This is because it provides enough tools for the exercises we propose, and is a tested, efficient software which allows us to perform these analyses easily and quickly.

Exercise 1. To validate a map against reference data/map

Aim

To assess to what extent the pattern of the CORINE map is similar to the pattern of the reference SIOSE map, which charts the real situation on the ground.

Materials

SIOSE Land Use Map Asturias Central Area 2011

CORINE Land Use Map Asturias Central Area 2011

Requisites

The two maps must be raster. The background class must be 0 or no data.

Execution

Step 1

One of the requisites of the “LecoS” plugin is that no category, apart from the background, is coded with the number 0. In our maps, the category “agricultural areas” is coded 0. The first step is therefore to reclassify the maps, so the background is coded 0 (currently it is coded 12) and all other categories have different codes other than 0.

The maps are reclassified using the Reclassify by table tool (Processing toolbox > Raster analysis > Reclassify by table). After opening the tool, indicate the map you want to reclassify (CORINE map) and fill in the “Reclassification table” with the values that will replace the existing values in the raster (Fig. 2). When filling in this table, bear in mind that the tool will search for values that are less than or equal to the maximum and greater than the minimum. In other words, if you reclassify as 2 (new value) the values with a maximum value of 1 and a minimum value of 0, all the pixels with value 1 will be reclassified as 2. 1 is the only value greater than 0 that is also less than or equal to 1.

Fig. 2
figure 2

Exercise 1. Step 1. Table required for the “Reclassify by Table” tool

Bearing these criteria in mind, fill in the reclassification table and run the tool (Fig. 3).

Fig. 3
figure 3

Exercise 1. Step 1. Reclassify by Table

Step 2

After running the tool, you will obtain a reclassified map that meets the requirements of the LecoS plugin. You are now in a position to calculate the spatial metrics. This is done by accessing the Landscape statistics option of the “LecoS” plugin via the following route: Raster > Landscape ecology > Landscape statistics.

Once there, in the “Landcover grid” box indicate the raster for which you want to calculate the spatial metrics (CORINE reclassified), the “No-data” value (0, which is the background) and the spatial resolution of the raster (50 m, which you can check in the layer properties). You must also select the particular metrics you want to obtain (Fig. 4).

Fig. 4
figure 4

Exercise 1. Step 2. LecoS plugin

Several spatial metrics can be selected at the same time, using the “Select multiple metrics” tab. In this case, we selected the following: Land cover; Landscape proportion; Number of patches; Greatest patch area; Smallest patch area; Mean patch area; Median patch area; Fractal dimension index; Like adjacencies; Patch cohesion index. Once you have done this, run the function.

If your computer is unable to calculate all the metrics at the same time, split the task into two (e.g. two groups of five metrics). In this case, after running the tool for the second time, the results must be gathered together in a single file, as the plugin creates one file for each time you run the tool.

Step 3

The last step is to repeat the whole workflow for the reference raster, i.e. for the SIOSE map. In this case, you will probably need to split the spatial metrics calculation into different steps as the plugin may be not able to handle all the information at once. As the SIOSE map is made up of a larger number of patches, the plugin will need more time to make all the calculations.

Results and Comments

Once the spatial metrics for each of the maps have been calculated, the results of the analysis will be stored in CSV files in the folder of your choice.

You will have one file for each time you have run the tool. The first step will therefore be to gather all the information together in one file to make it easier to compare the spatial metrics for the two maps (Table 1). This is done using a spreadsheet program such as OpenOffice Calc or Microsoft Excel. Once the results have been correctly organized, you can now compare the pattern of the two maps (Tables 1, 2, 3 and 4).

Table 1 Results from Exercise 1. Table showing the spatial metrics (Land Cover, Landscape proportion; Number of patches) for each category of the two maps that have been analysed (CORINE and SIOSE)

The “Land cover” and “Landscape proportion” metrics (Table 1) offer information about the space occupied by each category on the map. This gives us an insight into the composition of the landscape, i.e. the proportions or areas occupied by each category on the map, regardless of exactly where these categories are allocated.

The “Land cover” metric indicates the surface area in square metres occupied by each category. The “Landscape proportion” gives the proportion of the entire map (out of 1) occupied by each category. If the two maps have the same extent, both metrics will provide the same information, albeit in different units (square metres and percentage). Comparing maps with different extents is not recommended and could lead to important issues in the interpretation of the analysis.

In our case, the landscape composition of the two maps is very similar. All the categories are represented in similar proportions. Nonetheless, some differences were observed in the case of mineral extraction sites (Category 5 after reclassification), dump sites (Category 6) or road and rail networks (Category 7), among others.

The “Number of patches” (Table 1) indicates how many patches (contiguous areas with the same pixel value) make up each category. This metric is easy to understand and provides us very useful information about how fragmented a particular category is, so giving us an insight into the configuration of the landscape, i.e. about the way each category is allocated in the map.

Unlike landscape composition, important differences can be observed between the two maps in terms of landscape configuration. The SIOSE map is much more fragmented than the CORINE one. This difference is very significant for example in the road and rail networks category (Category 7 after reclassification). Whereas in CORINE this class is made up of just 28 patches, in SIOSE it is much more fragmented with 2,464 patches (Table 1).

These differences are to be expected given that the CORINE and SIOSE maps use different Minimum Mapping Units (MMU) and Minimum Mapping Widths (MMW). SIOSE represents homogenous areas covering over 0.5-2 ha with a minimum width of 15 m, whereas CORINE only shows areas of over 25 ha with a minimum width of 100 m. Many small patches that appear in SIOSE do not therefore appear on the CORINE map.

Those land use categories that usually appear on the ground in small areas, such as small dump sites, or with linear features such as most of the road network, are not represented on the CORINE map, although they do appear in SIOSE. This explains the differences between the two maps in terms of the areas or proportions of certain classes referred to above.

It would be wrong therefore to conclude that CORINE does not map these areas of disagreement between the two maps well. They do not appear in CORINE simply because it has different MMU and MMW rules.

The “Greatest patch area” and “Smallest patch area” metrics (Table 2) help us to characterize the degree of fragmentation referred to earlier. The first metric measures the area (in square metres) of the largest patch on the map. The second metric does the same for the smallest patch on the map.

Table 2 Results from Exercise 1. Table showing the spatial metrics (Greatest patch area; Smallest patch area) for each category of the two maps that have been analysed (CORINE and SIOSE)

These two metrics highlight CORINE’s simpler pattern and higher level of generalization. With a few exceptions, the largest patch in CORINE is usually larger than its counterpart in SIOSE. For the smallest patch, there are small differences between the maps. In most cases, the smallest patch occupies 2,500 m2 in both maps. In other words, the smallest patch covers a single pixel with a 50 m edge (50 × 50 = 2,500 m2). It does not comply with the MMU and MMW rules of CORINE. This may be due to the presence of isolated pixels on the edge of the map after clipping it or due to the rasterization process.

The “Mean patch area” and “Median patch area” metrics (Table 3) also help us characterize the fragmentation of the map. These metrics measure the mean area and the median area of all the patches belonging to a particular category. As one might imagine, mean and median patch area are always smaller for SIOSE than for CORINE because of SIOSE’s higher fragmentation. This is because the SIOSE map, due to its smaller MMU and MMW, draws more small polygons than CORINE, which tends to group them together in larger polygons.

Table 3 Results from Exercise 1. Table showing the spatial metrics (Mean patch area; Median patch area) for each category of the two maps that have been analysed (CORINE and SIOSE)

The “Fractal dimension index” (Table 4) measures the mean shape complexity of the patches that make up each category. Values closer to 1 indicate simple geometries, more closely resembling a square, whereas values closer to 2 indicate more complex geometries, which are less like the simple shape of a square.

Table 4 Results from Exercise 1. Table showing the spatial metrics (Fractal dimension index; Like adjacencies; Patch cohesion index) for each category of the two maps that have been analysed (CORINE and SIOSE)

Contrary to what might be expected, and with the exception of the port areas (Category 9 after reclassification), patch shapes were more complex in CORINE than SIOSE. This seems illogical given that SIOSE is made at a finer scale (1:25,000) than CORINE (1:100,000) and delimits land use areas more accurately.

In our case, CORINE has more complex patch shapes than SIOSE because of the rasterization of the CORINE and SIOSE vector databases, which reduced the complexity of the SIOSE polygons, resulting in more regular shapes.

Finally, “Like adjacencies” and the “Patch cohesion index” (Table 4) provide information about the compactness of the categories in a map. Values closer to 0 mean than the patches belonging to a particular category are very scattered. Values closer to 1 (Like adjacencies) or to 10 (Patch cohesion index) indicate that they are tightly clustered.

The “Like adjacencies” metric is based on the number of adjacencies between pixels, whereas the “Patch cohesion index” is obtained by calculating the ratio between the area and the perimeter of the patches. This means that although they provide information on a similar subject (compactness), they complement each other.

These metrics show that land uses are represented in a more compact (more clustered) manner in the CORINE database. This makes sense because of the lower degree of fragmentation and the greater generalization of CORINE compared to SIOSE.

All in all, even if important differences between the two maps could be identified in terms of landscape configuration, most of these are due to the different criteria used in the drawing of each map. This also applies to the small differences in terms of landscape composition. Our CORINE map must therefore be considered validated after comparison with SIOSE.

However, in order to be able to validate CORINE with certainty and to interpret the results of the spatial metrics more effectively, we should always compare the maps via visual inspection. In this case, visual inspection reveals that the differences identified by the spatial metrics are mostly due to the different criteria used in the drawing of each map, and not because they interpret land use in different ways. Complementary tools must therefore be used to contextualize the results of our validation or uncertainty analysis. If this is not done, there is a high chance that we will make incorrect assumptions due to not having all the relevant information.

Exercise 2. To validate a simulation against a reference map

Aim

To assess to what extent the pattern of our simulation is similar to the pattern of a reference map for the same year, which accurately reflects the real situation on the ground.

Materials

Simulation CORINE Asturias Central Area 2011

CORINE Land Use Map Asturias Central Area 2011

Requisites

The two maps must be raster. The background class must be 0 or no data.

For a proper validation, the reference map and the simulation must refer to the same year.

Execution

Step 1

In order to comply with the requirements of the “LecoS” plugin, which assumes that pixels with the value 0 are No Data or background, we must first reclassify the two maps we are going to compare. The background, which is coded as 12, must be reclassified as 0. Agricultural areas, which were coded as 0, must be reclassified as 1. All the remaining classes must be reclassified following the same criteria (new code = original code + 1).

The Reclassify by table (Processing toolbox > Raster analysis > Reclassify by table) tool will be used to reclassify the maps (Fig. 5). First, indicate the map you want to reclassify and, then, fill in the “Reclassification table” with the new category codes that will replace the existing ones in the raster.

Fig. 5
figure 5

Exercise 2. Step 1. Reclassify by Table

Step 2

Once the two maps have been reclassified, the next stage is to calculate the spatial metrics for each map: first for the simulation and then for the reference map. This is done using the Landscape statistics option in the “LecoS” plugin (Raster > Landscape ecology > Landscape statistics) (Fig. 6).

Fig. 6
figure 6

Exercise 2. Step 2. LecoS plugin

In “Landcover grid” select the raster for which you want to obtain the spatial metrics. You must also indicate the value of the background (No-data) and its spatial resolution (Cellsize). Finally, select the spatial metrics you are going to calculate.

Several spatial metrics can be selected at the same time using the “Select multiple metrics” tab. In this case, we selected the following metrics: Land cover; Landscape proportion; Number of patches; Greatest patch area; Smallest patch area; Mean patch area; Median patch area; Fractal dimension index; Like adjacencies; Patch cohesion index.

Results and Comments

Once the spatial metrics for each of the maps have been calculated, the results of the analysis will be stored in CSV files in the folder of your choice. To make it easier to interpret and compare the spatial metrics, the two files must be merged into one. This can be done using a spreadsheet program such as OpenOffice Calc or Microsoft Excel. This will display the results in a table similar to Table 5.

Table 5 Results from Exercise 2. Table showing the spatial metrics (Number of patches; Like adjacencies; Patch cohesion index) for each category of the simulation and the reference map

At first sight, the differences between the patterns of the two maps do not seem very significant. This makes sense in that we are calculating the metrics for the whole area of the maps. However, land use changes only affect a small portion of maps, usually less than 10% or even 5% of the studied areas. The changes we simulated or that actually happened on the ground according to the reference map will not therefore have a dramatic impact on the spatial metrics for the whole map.

Even so, some differences can be observed. Agricultural areas (Category 1 after reclassification) and vegetation areas (Category 2) are made up of a larger number of patches in the simulation than in the reference map (Table 5). By contrast, urban fabric (Category 3) and industrial and commercial areas (Category 4) are made up of a slightly smaller number of patches.

These trends may indicate that the changes simulated as transitions to urban fabric and to industrial and commercial areas have made these classes more compact (patches that were not previously connected have now become connected with the simulated changes). That is, these classes did not grow in an isolated way, but via the expansion of previously existing patches. The slight differences between the reference map and the simulation in the “Like adjacencies” and “Patch cohesion index” metrics for industrial and commercial areas (Category 4 after reclassification) also point in this direction.

In the process of expansion of urban fabric and industrial areas, some patches of agricultural and vegetation areas could become isolated, so increasing the fragmentation of the category. This would explain why there are more patches in these categories in the simulation than in the reference map.

The difference in pattern between the simulation and the reference map can best be calculated using spreadsheet software, as described in the example for Table 6. In this table, we have subtracted the spatial metric for each category in the simulation from the value for the same metric in the reference map. Thus, for instance, the reference map has 602,500 m2 more agricultural areas (Category 1) than the simulation. By contrast, the simulation has 1,205,000 m2 more vegetation areas (Category 2) than the reference map. In our simulation, more space is also allocated to urban fabric (Category 3) and industrial and commercial areas (Category 4) than in the reference map.

Table 6 Results from Exercise 2. Difference in the value of the spatial metrics (Land Cover; Greatest patch area; Mean patch area) calculated for the simulation and the reference map. The results on the table indicate how far or close are the values of the spatial metrics in the two maps

These differences in the total area allocated to each category help us understand how the model calculates the changes it simulates. If the model had simulated the same amount of change that actually occurred on the maps, no differences would be noticed.

In our simulation, we did not actively model the vacant classes. Thus, whereas according to the reference map there were many vegetation areas that changed to agricultural areas, in our simulation this did not happen. As a consequence, our simulation has more vegetation areas, but less agricultural areas than the reference map.

The “Greatest patch area” metric shows that we did not model one of the biggest industrial developments in the study area correctly. The largest patch in our simulation is 450,000 m2 smaller than the one in the reference map. The opposite was true in the case of urban fabric. According to the model, many pixels were considered to have changed as a result of the expansion of large pre-existing patches, when this trend was in fact not that strong according to the reference map.

If we focus on the “Mean patch area” metric for the two categories we modelled actively (3 and 4) we can see how in both cases the mean area of patches is always bigger in the simulation than in the reference map. This may be due to the same process as in urban fabric, i.e. most of the changes are simulated as expansions of pre-existing large patches.

In all other categories apart from the first 4 (1, 2, 3, 4), there are important differences between the two maps. However, as changes in these categories were not modelled in the simulation (they remained invariant), the differences between the maps are due to changes that took place in the reference map but were not simulated.

To sum up, it is difficult with the information available to us to understand whether the pattern of the changes we simulated is valid or not. We have various clues about the pattern of the changes (more compact and connected than in the reference map), but these trends are best confirmed by visual inspection. Calculating the spatial metrics solely for the areas that changed is also highly recommended and can provide additional insight.

Exercise 3. To validate simulated changes against a reference map of changes

Aim

To assess to what extent the pattern of the changes we simulated is similar to the pattern of a reference map of changes for the same year, which accurately reflects the real situation on the ground.

Materials

CORINE Land Use Changes Asturias Central Area 2005–2011

Simulated CORINE changes Asturias Central Area 2005–2011

Requisites

The two maps must be raster. The background class must be 0 or no data.

For a proper validation, the changes in the reference map must refer to the same time period as the simulation period.

Execution

Step 1

Given that the background is already coded 0 in the two maps charting changes, we do not need to take any preliminary steps prior to calculating the spatial metrics. This can be done directly using the Landscape statistics option in the “LecoS” plugin (Raster > Landscape ecology > Landscape statistics).

In the tool, we must indicate the raster for which we want to calculate the spatial metrics (Landcover grid), the value of the background in our maps (No-Data) and their spatial resolution (Fig. 7). Several spatial metrics can be selected at the same time, using the “Select multiple metrics” tab.

Fig. 7
figure 7

Exercise 3. Step 1. LecoS plugin

In this analysis, we will be calculating the following metrics: Land cover; Number of patches; Greatest patch area; Smallest patch area; Mean patch area; Median patch area; Fractal dimension index; Like adjacencies; Patch cohesion index.

Step 2

We repeat this process for the second map.

Results and Comments

Once we have run the tool twice, once for each map, we will have two CSV files with the metrics for each of the change maps. These will be saved in the specified folder.

The reference map of changes includes land use changes for many categories (1, 2, 5, 6, 7, 8, 10 and 11) that are not drawn on the simulated map of changes. This is because we only actively simulated urban fabric (Category 3) and industrial and commercial areas (4). The rest of the categories were only simulated passively (1, 2) or remained invariant during the simulation (5, 6, 7, 8, 9, 10, 11, 12). As a result, the map of simulated changes only includes patches from Categories 3 and 4 (urban fabric, industrial and commercial areas). We will therefore only compare the spatial metrics for these categories.

The changes we simulated are quantitatively the same as the reference changes (Table 7). We can therefore say that our model correctly predicted the quantity of changes that happened in our study area.

Table 7 Results from Exercise 3. Table showing the spatial metrics (Land Cover; Number of patches; Greatest patch area) for each actively simulated category in the simulation and the reference map

On the other hand, the pattern of the simulated changes seems to be very different from the pattern of the reference map of changes. In the reference map, the changes took place in just a few patches and most of the pixels that changed are allocated close to each other. In the simulation, the changes are fragmented in many different patches (Table 7). The “Mean patch area” and “Median patch area” metrics confirm this trend (Table 8). The simulated changes take place in very small patches, made up of just a few pixels.

Table 8 Results from Exercise 3. Table showing the spatial metrics (Mean patch area; Median patch area) for each actively simulated category in the simulation and the reference map

When working with Cellular Automata models, change usually takes place organically as an expansion of existing patches. In the real world, however, changes in urban and industrial areas tend to happen at the same time over entire cadastral parcels. Often, these parcels are quite big, comprising a large number of pixels. However, as CA models usually simulate change at the pixel level, they are not normally capable of simulating big patches of change covering large numbers of pixels. Our model therefore behaves differently from the real processes taking place on the ground, hence the disagreements in the pattern of simulated changes.

Other metrics, such as “Like adjacencies” and “Patch cohesion index” confirm this behaviour. The pixels in the reference map are better grouped than those in the simulated map (Table 9). This is also manifested by the “Greatest patch area” metric (Table 7). The largest patch is always much bigger in the reference map of changes than in the simulation.

Table 9 Results from Exercise 3. Table showing the spatial metrics (Fractal dimension index; Like adjacencies; Patch cohesion index) for each actively simulated category in the simulation and the reference map

In conclusion, the pattern of changes we simulated is very different to the pattern of changes in the reference map. However, this does not mean that the changes we simulated have altered the pattern of the simulated landscape. On the contrary, as we discovered in the previous exercise, the pattern of the whole landscape remains very similar.

It is important to remember here that we are only calculating the pattern of the areas that changed, without viewing them in any larger context. By contrast, when we calculate the spatial metrics for the whole map, we also consider the context and can therefore assess whether the changes have altered the pattern of the map. Thus, both analyses are complementary. We recommend users to carry out both analyses when validating the pattern of their simulations.

Finally, a qualitative validation through visual inspection is highly recommended for contextualizing the results and understanding them better.

Exercise 4. To validate a series of maps with two or more time points

Aim

To test the consistency of the pattern of land uses in a series of LUC maps made up of two different time points.

Materials

CORINE Land Use Map Asturias Central Area 2005 v.0

CORINE Land Use Map Asturias Central Area 2011

Requisites

The two maps must be raster. The background class must be 0 or no data.

Execution

Step 1

In order to comply with the requirements of the “LecoS” plugin, the maps must be reclassified to ensure that the background code is 0 and all other categories have a positive code different from 0. This is done using the Reclassify by table tool (Processing toolbox > Raster analysis > Reclassify by table) (Fig. 8).

Fig. 8
figure 8

Exercise 4. Step 1. Reclassify by Table

After opening the tool, we indicate the map we want to reclassify and then fill in the “Reclassification table” with the new category codes that will replace the existing ones in the raster (Fig. 9).

Fig. 9
figure 9

Exercise 4. Step 1. Table required for the “Reclassify by Table” tool

Step 2

Once the categories have been reclassified, the spatial metrics for each map can be calculated using the Landscape statistics option in the “LecoS” plugin (Raster > Landscape ecology > Landscape statistics) (Fig. 10).

Fig. 10
figure 10

Exercise 4. Step 2. LecoS plugin

After opening the tool, we select the raster for which we wish to obtain the metrics (Landcover grid), the background value of the raster (No-Data) and its spatial resolution (cellsize). We then select the different metrics we want to calculate in the “Select multiple metrics” tab. In this case we selected the following: Land cover; Landscape proportion; Number of patches; Greatest patch area; Smallest patch area; Mean patch area; Median patch area; Fractal dimension index; Like adjacencies; Patch cohesion index.

Results and Comments

After running the tool, the metrics are displayed in two CSV files which are saved in the specified folder.

The metrics reveal important differences between the two maps in terms of landscape configuration, i.e. the way land uses are allocated on each map.

The categories in the CORINE 2011 map are made up of many more patches than the same categories in the CORINE 2005 map (Table 10). In some cases, such as urban fabric (Category 3 after reclassification), there are twice as many patches in the CORINE 2011 map (92) as in the CORINE 2005 map (44).

Table 10 Results from Exercise 4. Table showing the spatial metrics (Number of patches; Like adjacencies; Patch cohesion index) for each category of the two maps that have been analysed (CORINE 2005 and CORINE 2011)

The “Like adjacencies” and “Patch cohesion index” metrics also show slight differences between the maps. This is unusual when comparing a time series of land use maps, as these metrics are not usually sensitive to small changes in the landscape. With the exception of highly dynamic environments, in most of the study areas we might wish to assess, change affects less than 5% of the landscape. We should not therefore expect meaningful differences in the spatial metrics that characterize the landscape over a short period such as that used in our example (2005–2011).

The “Land cover” metrics show big differences between the maps in terms of the areas covered by each category (Table 11). One would not expect the composition of the landscape to change so much in just 6 years. Agricultural areas occupy 28,710,000 m2 more in the CORINE 2005 map than in the 2011 one. That means that 11,484 pixels changed over the 6-year period. However, a process of change of such magnitude was not observed on the ground in the study area.

Table 11 Results from Exercise 4. Difference in the value of the spatial metrics (Land Cover; Greatest patch area; Mean patch area) calculated for the two maps that have been analysed (CORINE 2005 and CORINE 2011). The results on the table indicate how far or close are the values of the spatial metrics in the two maps

The “Greatest patch area” and “Mean patch area” metrics also differ greatly for the two maps in the time series (Table 11). These differences are also much bigger than might be expected due to changes in the landscape over the timeframe analysed.

These results indicate that there are many differences between the two maps that are not due to real changes in the landscape. These differences may be due to technical issues within the time series in that different methods were used to produce CORINE 2005 and 2011.

These conclusions were confirmed by a visual inspection of the two maps, an additional check that is highly recommended to complement the results of this analysis.

Exercise 5. To validate a series of maps with two or more time points (vector)

Aim

To study the pattern of a specific transition (from scrubland to forest) in our study area (Ariège Valley) for a given period (2000–2018).

Materials

CORINE Land Cover Map Val d’Ariège 2000

CORINE Land Cover Map Val d’Ariège 2018

Requisites

All raster maps must have the same resolution, extent and projection.

Execution

Step 1

We begin by extracting the changes we want to study (transition from scrub to forest) with the Raster Calculator (Fig. 11). In the raster calculator expression box, we write an expression to obtain a map with the features that were scrub in 2000 (Category 4) and forest in 2018 (Category 3): “CLC_2000@1” = 4 AND “CLC_2018@1” = 3.

Fig. 11
figure 11

Exercise 5. Step 1. Raster calculator

This produces a raster showing the areas that underwent this transition (Fig. 12).

Fig. 12
figure 12

Intermediate output from Exercise 5. Map showing areas that transition from scrub to forest

Step 2

Once the raster for this transition has been obtained, it must be converted into vector format (polygons) using the Polygonize GDAL tool. When making this conversion, the “Use 8-connectedness” option must be selected (Fig. 13). In this way, the tool considers all pixels diagonal to other pixels as part of the same polygon. If this option is not selected, pixels situated diagonal to other pixels are considered as separate polygons.

Fig. 13
figure 13

Exercise 5. Step 2. Polygonize (Raster to Vector)

Step 3

Once the polygons that undergo this transition have been obtained in vector format, we can then calculate their spatial metrics using the SAGA Polygon Shape Indices tool (Fig. 14).

Fig. 14
figure 14

Exercise 5. Step 3. Polygon shape indices

After calculating the spatial metrics, we obtain a vector file. The values for these metrics are calculated for each polygon and are stored in the attribute table of the vector (Fig. 15). The metrics used in this case were: area; perimeter; ratio perimeter / area; ratio perimeter / square root area; maximum distance; maximum distance / area; maximum distance / square root area; and shape index.

Fig. 15
figure 15

Results from Exercise 5. QGIS table showing the spatial metrics (Area, Perimeter, Perimeter/Area; Perimeter / Square root of the area; Maximum distance; Distance / Area; Distance / Square root of the area; Shape index) for each transition area (polygon) of the analysed map

Step 4

In order to better interpret the general pattern of all the polygons that undergo this transition, the results of the metrics can be exported to a spreadsheet where statistics such as the mean, standard deviation, minimum and maximum can be calculated (Table 12).

Table 12 Results from Exercise 5. Table showing the mean, standard deviation, minimum and maximum of the spatial metrics (Area, Perimeter, Perimeter/Area; Perimeter / Square root of the area; Maximum distance; Distance / Area; Distance / Square root of the area; Shape index) calculated for the areas that underwent the scrub to forest transition

Results and Comments

The pattern of the areas that transition from scrubland (2000) to forest (2018) is very diverse, with patches of varying size, capacity and shape complexity. The smallest polygon covers only 224 m2, while the largest occupies 2,462,094.65 m2. Perimeter lengths also vary enormously: from almost 60 m to 13,155.37 m. These results indicate that the areas that transition from scrubland to forests have very different sizes and shapes.

The perimeter / area (P/A) ratio is a measure of the compactness of the patches. Lower P/A values mean more compact polygons, whereas higher P/A values mean elongated or less compact polygons. The maximum distance metric indicates the longest segment of a polygon. The maximum distance / area (D/A) ratio is a measure of how elongated the polygon is. Lower values indicate more compact, less elongated polygons, whereas higher values mean the opposite. Finally, the shape index measures the shape complexity of a patch, using the following formula: Perimeter/(2 * Square Root(PI * Area).

The metrics calculated in this exercise can be compared with the metrics obtained and analysed in Exercise 6 below, which carries out the same analysis with raster data. The comparison will offer an insight into how data format (vector or raster) can affect the results of a pattern analysis.

Exercise 6. To validate a series of maps with two or more time points (raster)

Aim

To study the pattern of a specific transition (scrub into forest) in our study area (Ariège Valley) for a given period (2000–2018).

Materials

CORINE Land Cover Map Val d’Ariège 2000

CORINE Land Cover Map Val d’Ariège 2018

Requisites

All maps must be rasters and have the same resolution, extent and projection.

Execution

Step 1

We begin by extracting the specific changes we want to study from our series of maps, i.e. the pixels that transitioned from scrub (Category 4) to forest (Category 3). We do this by introducing the following expression in the Raster Calculator: “CLC_2000@1” = 4 AND “CLC_2018@1” = 3 (Fig. 11).

Step 2

Once the raster with the areas that changed from scrub to forest has been obtained, we then calculate their spatial metrics using the Landscape statistics option from the “LecoS” plugin (Raster > Landscape ecology > Landscape statistics) (Fig. 16). After opening the tool, we must select the raster layer to be analysed, the output folder where the results will be saved and the metrics we want to calculate (Fig. 17). To choose the metrics, we must select the “Multiple metrics” tab. In this case, we selected 14 different metrics: Landscape Proportion, Edge length, Edge density, Number of Patches, Patch density, Greatest patch area, Smallest patch area, Mean patch area, Median patch area, Fractal Dimension Index, Mean patch shape ratio, Landscape Division, Patch cohesion index and Splitting index.

Fig. 16
figure 16

Exercise 6. Step 2. Landscape statistics option of the LecoS plugin

Fig. 17
figure 17

Exercise 6. Step 2. LecoS plugin

Results and Comments

Once the spatial metrics have been calculated, the plugin creates a CSV file in the output folder with the results.

The results show that 37 different patches underwent the transition from scrub to forest, as shown in the “Number of patches” metric in Table 13. These patches have different sizes, varying from 225m2 to 2,467,575m2. There are a few small patches, but most patches are big, as revealed by the mean (237,539m2) and median (111,600m2) metrics.

Table 13 Results from Exercise 6. Table showing the spatial metrics (Landscape proportion; Edge length; Edge density; Number of patches; Patch density; Greatest patch area; Smallest patch area; Mean patch area; Median patch area; Fractal dimension index; Mean patch shape ratio; Landscape division; Patch cohesion index; Splitting index) for the areas that underwent the scrub to forest transition

The “Landscape proportion” metric indicates the percentage of the studied landscape occupied by the category in question. As we are only considering one category in our analysis (the areas that transition from scrubland to forests), this category occupies 100% of the studied landscape and therefore has a landscape proportion value of 1 (Table 13). The fractal dimension index informs about the complexity of the patches in the specified category. Values closer to 2 mean more complex shapes, whereas values closer to 1 mean simpler shapes.

The landscape division, patch cohesion and splitting indices assess the compactness or fragmentation of the patches that make up a class, i.e. how well aggregated they are. A “Landscape division” value close to 1 means a very fragmented landscape, whereas values close to 0 indicate a landscape made up of a single patch. A “Patch cohesion” value of 0 means one isolated patch, whereas values closer to 100 mean more aggregated patches. A “Splitting index” value of 1 indicates a landscape made up of a single patch, while splitting index values of more than 1 indicate a progressively more fragmented landscape.

If we compare these results to those obtained in vector format (Exercise 5), we can see that the same values were obtained for comparable measures (e.g. mean area, greatest / smallest area), while other measures use different formulas. These include the shape and compacity indices (standardized or not, area-weighted or not, completed by a constant or not). The LecoS plugin also offers complementary indices which are not calculated in vector format, such as the fractal dimension or the splitting index. In addition, whereas the spatial metrics in vector can be calculated individually for each patch or polygon (Exercise 5), this is not possible in raster format when using the LecoS plugin. The plugin usually calculates the mean values of all the patches for each metric.