ANINTRODUCTIONTOGIS


Perform an analysis by combining raster and vector layers


For this tutorial, we will study the distribution of crops by soil type. For this, we will combine a vector layer (the boundaries of the fields) with a raster layer (the soil map).

Field borders are taken from the Land Parcel Identification System, which provides field boundaries and type of crops grown in a given year for farmers receiving subsidies from the European Common Agricultural Policy. For France, data are available here for download.

Based on these data, here is an example of the distribution of fields in the Puy-de-Dôme (France):

Figure 1 Spatial distribution of crops in the Puy-de-Dôme department


Here, we will investigate the relationship between soil characteristics and this crop distribution.

I. Add crop layer

To simplify, we will work with a vector layer of field borders containing only two crops (grain maize and temporary grasslands) for years 2018. This layer, called ‘RPG2018_63_2CropsOnly’, may be downloaded here.

In the attribute table, column ‘CODE_CULTU’, grain corn is referenced by the code ‘MIS’ and temporary grassland by the code ‘PTR’ (description of other ‘CODE_CULTU’ codes may be available here).

Practise: Make a choropleth map to highlight the spatial distribution of both crops.


The column “SURF_PARC” gives the surface of each field (in hectares). From this column, we will calculate the median field surface and the total surface for each crop in the Puy-de-Dôme department thanks to the GroupStats extension:

  • Vector > GroupStats

If the GroupStats extension is not available, it is possible to install it using the Plugins manager.

Then open GroupStats and fill the window as follows:


Figure 2 Calculation of descriptive statistics from the attribute table with GroupStats


II. Download soil maps from the SoilGrids project

The SoilGrids projects combines soil observations, remote sensing and machine learning to create digital soil maps. These maps may be visualized and downloaded here.

Rasters can be created for different physical (clay content, bulk density…) or chemical (organic carbon, pH…) soil characteristics and six different depths (from 0 to 2 meters).

These rasters may be downloaded as follows:


Figure 3 Downloading soil maps with SoilGrids


You can thus download the map of the feature of your choice.

III. How to compare crop distribution and soil map

This part will focus on the clay content map (raster ‘Clay_15_30cm_63.tif’ available here) but you can also perform the same procedure with the raster downloaded in the previous part.

Add the raster layer to your QGIS project:

  • Layer > Add layer > Add raster layer

We will now assign an average value per field (grain maize or temporary grassland) for this soil characteristic.

Open the Toolbox:

  • Processing > Toolbox

In the search bar of the Toolbox, look for Zonal statistics. If this extension is not available, it is possible to install it using the Plugins manager.

Open Zonal statistics.


Figure 4 Compute mean clay value per field


The calculated statistic will appear as a new column in the attribute table of the vector layer.

Practise: Using GroupStats, compute the mean clay value per crop from the vector layer with fields boundaries.