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):
Here, we will investigate the relationship between soil characteristics and this crop distribution.
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:
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:
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:
You can thus download the map of the feature of your choice.
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:
We will now assign an average value per field (grain maize or temporary grassland) for this soil characteristic.
Open the 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.
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.