Yield Erosion Sediment (YES): A PyQGIS Plug-In for the Sediments Production Calculation Based on the Erosion Potential Method

: The Erosion Potential Method is a model for qualifying the erosion severity and estimating the total annual sediment yield of a catchment. The method includes a diverse set of equations, which are inﬂuenced by di ﬀ erent factors such as geology, morphology, climate and soil use. This study describes a PyQGIS YES plug-in, which allows a semiautomatized use of the Erosion Potential Method in Geographic Information System (GIS) environment. In detail, we developed a plug-in using Python programming language that is made up of a series of operations allowing one to estimate sediment production through a wizard procedure. The ﬁrst stage consists of data preprocessing and involves: (i) loading of the layers (e.g., geological map); (ii) spatial selection of the catchment area; (iii) elaboration of loaded layers (e.g., clipping). During the second stage, the user assigns a relative coe ﬃ cient to each factor either by selecting a preloaded value from bibliographic sources or by inserting a value inferred from ﬁeld observations and data. The third stage includes the addition of rainfall and temperature values loaded as: average values, point shapeﬁles (the plug-in calculates the average monthly values) or tables (the plug-in creates the linear regression depending on altitude). During the ﬁnal stage, the plug-in executes the equation of EPM Model obtaining the sediment yield value at basin scale. Additionally, the user can use the “squared cell” method choosing the appropriate option in the setting dialogue of the plug-in. This method divides the catchment area in a regularly-spaced grid which allows one to carry out the distribution map of the sediment production during the ﬁnal stage.


Introduction
Quantifying erosion and sediment production in river catchments is a key issue in land use management, as well as in hydrological risk analysis [1][2][3] and the management of coastal erosion [4,5]. The qualitative and quantitative understanding of the processes of sediment erosion and transfer, their spatial and timing distribution and their relationship to anthropogenic factors are indeed crucial aspects to be considered in successful land use planning and coastal-hydrogeological mitigation risks [6,7].
In literature there are several semiquantitative methods developed for assessing erosion and sediment yield at the catchment scale, some of which are summarized in Table 1. These methods are based on empirical equations that take into account several parameters such as climate, rainfall erosivity, land use, ground cover, soil, geology, geomorphology and topography (see [8] and [9]). One of the first empirical approximations to the assessment of erosion at the basin scale was developed by [10,11] and is based on a scoring approach for only three descriptive variables, namely soil cover, soil resistance, type and extent of erosion. Other quantitative factors are considered as descriptors of the catchment conditions. The model is fitted with empirical coefficients that allow one to quantify the average annual sediment yield. This method takes into account five factors depending on: geology, soil use, climatic factors (mean annual rainfall and temperature) and topographic features. [12] developed the Erosion Potential Method (EPM) based on empirical values of each parameter. The EPM method is based on the following equation: where W y is the estimated annual sediment production (m 3 /year), T is the Temperature coefficient and is calculated as: where T 0 is the average temperature ( • C), h y is the mean annual rainfall (mm), S is the area of the watershed (km 2 ) and Z is the coefficient of relative erosion calculated as: where X is the coefficient of land cover, Y is the coefficient of soil resistance (related to the outcropping rocks), φ is the coefficient of type and extent of erosion; Im is the average slope of the watershed. The EPM method has been successfully used in Mediterranean areas such as Italy, Switzerland, Greece, Slovenia and Croatia [13][14][15][16]. In recent decades, the Gavrilović method has been extensively applied in Geographic Information System (GIS) environment [17][18][19][20][21][22][23]. However, one of the challenges in the application of the EPM model in GIS environment is the time required in the geoprocessing, calibration and validation processes.
In this paper we present a newly developed PyQGIS plug-in Yield Erosion Sediment (YES), which allows a semiautomatized application of the EPM in GIS environment. The plug-in carries out automatically a series of GIS operations during the data preprocessing, e.g., the clipping of geological and soil use maps based on the selected catchment area. Furthermore, the plug-in saves all the operations needed for the final calculation, allowing the user to correct possible errors (e.g., parameters assignation) without having to reiterate all processing.
Unlike previous GIS application of the EPM model, our plug-in provides an estimate of sediment erosion and transfer at the scale of single cell [24,25], which makes it possible to produce maps of sediment production, in order to recognize the areas with higher and lower sediment yield. Furthermore, YES permits the application of the EPM by dividing the catchment area in squared cells of the desired size and consequently to obtain the distribution map of the sediment production, while the previous GIS application allowed one to calculate only the total sediment yield and not information about its arrangement in the basin. The plug-in YES provides a powerful tool for choosing the best location for field measurements and calibration and validation processes.
In this paper we present the plug-in, along with an application in the catchment area draining to the Savuto Lake located in the Calabria Region (southern Italy), which is widely affected by coastal erosion due lack of river sediments nourishment (e.g., [26,27]).

Methodology
We developed the plug-in as an application based on QGIS API (Application Programming Interface). The plug-in was developed using the Python language and consists of a series of operations ( Figure 1), which drive the user toward the sediment production calculation through a wizard procedure. In the following sections we will describe each stage included in the application step by step.

Stage 1-Preprocessing
At the first launch the application pops up a dialog, which allows one to choose between the standard and "squared cell" methods and to set the workspace folder where all the output data In the following sections we will describe each stage included in the application step by step.

Stage 1-Preprocessing
At the first launch the application pops up a dialog, which allows one to choose between the standard and "squared cell" methods and to set the workspace folder where all the output data (vector and raster) will be stored ( Figure 2). The next step consists of the following operations: • loading layers needed for the geoprocessing analysis as the Digital Elevation Model (DEM) (in ASCII or GeoTIFF formats), geological map, soil use map, drainage network, thermo-pluviometric values or maps, landslides map; • spatial selection of the catchment area; • selection of loaded layers for the following operations, e.g., clipping and buffering of the input vector layer, clipping of the Digital Elevation Model and reclassify for the analysis of slope data (using the desired slope classes). At the end of stage 1 all the necessary layers (with the coordinate system selected by the user) are ready for the EPM application. In the following sections we will describe each stage included in the application step by step.

Stage 1-Preprocessing
At the first launch the application pops up a dialog, which allows one to choose between the standard and "squared cell" methods and to set the workspace folder where all the output data (vector and raster) will be stored ( Figure 2). The next step consists of the following operations: • loading layers needed for the geoprocessing analysis as the Digital Elevation Model (DEM) (in ASCII or GeoTIFF formats), geological map, soil use map, drainage network, thermo-pluviometric values or maps, landslides map; • spatial selection of the catchment area; • selection of loaded layers for the following operations, e.g., clipping and buffering of the input vector layer, clipping of the Digital Elevation Model and reclassify for the analysis of slope data (using the desired slope classes). At the end of stage 1 all the necessary layers (with the coordinate system selected by the user) are ready for the EPM application.

Stage 2-Selection of the Gavrilović Coefficients
For each parameter (geology, soil use, etc.) the relative empirical coefficients must be decided. The user can select the default option suggested by [28] and [12] (Coefficient description in Figure 3) or type them into the Coefficient box ( Figure 3). The choice of new coefficients is usually based on bibliographic sources (e.g., [16,29,30]), field surveys (e.g., geomechanical rocks characterization and weathering grade) and laboratory measurements (e.g., cutting tests, petrographic, mineralogical and geochemical analysis).

Stage 2-Selection of the Gavrilović Coefficients
For each parameter (geology, soil use, etc.) the relative empirical coefficients must be decided. The user can select the default option suggested by [28] and [12] (Coefficient description in Figure 3) or type them into the Coefficient box ( Figure 3). The choice of new coefficients is usually based on bibliographic sources (e.g., [16,29,30]), field surveys (e.g., geomechanical rocks characterization and weathering grade) and laboratory measurements (e.g., cutting tests, petrographic, mineralogical and geochemical analysis).

Stage 3-Thermopluviometric Data
The rainfall and temperature data can be loaded as average values (for the analyzed period), point vector layer or table (.csv, .txt). In the latter case, the plug-in calculates the linear regression (Figure 4a) rainfall-altitude and temperature-altitude, which allows one to obtain a distribution map by using the elevation values, as described by [31]. If the thermo-pluviometric data are loaded as point vector data, the plug-in also displays the relative histogram plot (Figure 4b).

Stage 3-Thermopluviometric Data
The rainfall and temperature data can be loaded as average values (for the analyzed period), point vector layer or table (.csv, .txt). In the latter case, the plug-in calculates the linear regression ( Figure 4a) rainfall-altitude and temperature-altitude, which allows one to obtain a distribution map by using the elevation values, as described by [31]. If the thermo-pluviometric data are loaded as point vector data, the plug-in also displays the relative histogram plot (Figure 4b).

Stage 4-Final Calculation
During the last stage, the user must assign a layer (previously loaded and elaborated) to each parameter of the Gavrilović equation ( Figure 5). Finally, the sediment production estimation (Wy) (m 3 /year) is obtained along with a final report which shows all applied parameters.

Stage 3-Thermopluviometric Data
The rainfall and temperature data can be loaded as average values (for the analyzed period), point vector layer or table (.csv, .txt). In the latter case, the plug-in calculates the linear regression (Figure 4a) rainfall-altitude and temperature-altitude, which allows one to obtain a distribution map by using the elevation values, as described by [31]. If the thermo-pluviometric data are loaded as point vector data, the plug-in also displays the relative histogram plot (Figure 4b).

Stage 4-Final Calculation
During the last stage, the user must assign a layer (previously loaded and elaborated) to each parameter of the Gavrilović equation ( Figure 5). Finally, the sediment production estimation (Wy) (m 3 /year) is obtained along with a final report which shows all applied parameters.

Stage 4-Final Calculation
During the last stage, the user must assign a layer (previously loaded and elaborated) to each parameter of the Gavrilović equation ( Figure 5). Finally, the sediment production estimation (W y ) (m 3 /year) is obtained along with a final report which shows all applied parameters.
During stage 1, if the user chooses the "squared cell" method in addition to the final report, the plug-in creates the distribution maps (in grid format) of the Gavrilović parameters (X, Y and φ), for estimation of the relative erosion coefficient Z and of the sediment production estimation (W y ). During stage 1, if the user chooses the "squared cell" method in addition to the final report, the plug-in creates the distribution maps (in grid format) of the Gavrilović parameters (X, Y and ), for estimation of the relative erosion coefficient Z and of the sediment production estimation (Wy).

Test Application to the Savuto Lake Catchment
We tested the plug-in using several catchment areas of Calabria Region (southern Italy). Here we describe the case study of the catchment to the Savuto Lake ( Figure 6). The Savuto Lake is an artificial reservoir located in the upstream sector of the Savuto River along the west side of the Sila Massif (middle Calabria). The latter represents a section of the Hercynian orogenic belt [32] and consists of a massif with a plateau characterized by an average altitude of about 1200 m a.s.l. The massif is made up by Paleozoic intrusive and metamorphic (from low to high grade) rocks representing the so-called Sila Units [33], which are characterized by a deep long-term weathering [34,35]. During Quaternary the Sila Massif was affected by uplift [36,37] due to regional geodynamics. Subsidence phenomena are recorded in the surrounding areas up to now [38,39].
The Savuto Lake catchment has an area of 44.68 km 2 , low slope (average value of 17.65%) and an altitude ranging from 1170 to 1600 m a.s.l. From 1978 to 2007, an average annual rainfall and temperature of 1224 mm and 13 °C, respectively, had been reported [40].

Test Application to the Savuto Lake Catchment
We tested the plug-in using several catchment areas of Calabria Region (southern Italy). Here we describe the case study of the catchment to the Savuto Lake ( Figure 6). During stage 1, if the user chooses the "squared cell" method in addition to the final report, the plug-in creates the distribution maps (in grid format) of the Gavrilović parameters (X, Y and ), for estimation of the relative erosion coefficient Z and of the sediment production estimation (Wy).

Test Application to the Savuto Lake Catchment
We tested the plug-in using several catchment areas of Calabria Region (southern Italy). Here we describe the case study of the catchment to the Savuto Lake ( Figure 6). The Savuto Lake is an artificial reservoir located in the upstream sector of the Savuto River along the west side of the Sila Massif (middle Calabria). The latter represents a section of the Hercynian orogenic belt [32] and consists of a massif with a plateau characterized by an average altitude of about 1200 m a.s.l. The massif is made up by Paleozoic intrusive and metamorphic (from low to high grade) rocks representing the so-called Sila Units [33], which are characterized by a deep long-term weathering [34,35]. During Quaternary the Sila Massif was affected by uplift [36,37] due to regional geodynamics. Subsidence phenomena are recorded in the surrounding areas up to now [38,39].
The Savuto Lake catchment has an area of 44.68 km 2 , low slope (average value of 17.65%) and an altitude ranging from 1170 to 1600 m a.s.l. From 1978 to 2007, an average annual rainfall and temperature of 1224 mm and 13 °C, respectively, had been reported [40]. The Savuto Lake is an artificial reservoir located in the upstream sector of the Savuto River along the west side of the Sila Massif (middle Calabria). The latter represents a section of the Hercynian orogenic belt [32] and consists of a massif with a plateau characterized by an average altitude of about 1200 m a.s.l. The massif is made up by Paleozoic intrusive and metamorphic (from low to high grade) rocks representing the so-called Sila Units [33], which are characterized by a deep long-term weathering [34,35]. During Quaternary the Sila Massif was affected by uplift [36,37] due to regional geodynamics. Subsidence phenomena are recorded in the surrounding areas up to now [38,39].
The Savuto Lake catchment has an area of 44.68 km 2 , low slope (average value of 17.65%) and an altitude ranging from 1170 to 1600 m a.s.l. From 1978 to 2007, an average annual rainfall and temperature of 1224 mm and 13 • C, respectively, had been reported [40].
During stage 1, the adopted data consist of (Figure 7a-c): geological map [41], soil use map [42], landslides and drainage network [43], DEM 20 × 20 m (WCS The National Geoportal of the Ministry of Environment and Protection of Land and Sea).
Geosciences 2020, 10, x FOR PEER REVIEW 7 of 13 During stage 1, the adopted data consist of (Figure 7a-c): geological map [41], soil use map [42], landslides and drainage network [43], DEM 20 × 20 m (WCS The National Geoportal of the Ministry of Environment and Protection of Land and Sea). The first calculation was carried out by applying the standard method obtaining a sediment production estimation of 21,821.6 m 3 /year for the whole catchment area. The second computation was performed by using the "squared cell" method (using 250 × 250m cell), in order to obtain the distribution maps of Gavrilović parameters and that of sediment production estimation (Figure 8).
The parameters X, Y and were obtained through the following equation for both the standard and the squared cell methods: where Ai is the area in km 2 of the element (soil use, soil resistance, geomorphology), AT is the total area (basin area for standard method and cell area for squared cell) and Vi indicates the value of the coefficient assigned (see Table 2).
The multiplicative values (Table 3) used to calculate the sediment volume through the Equations (1)-(3) were calculated taking into account the values proposed by [28] and allowing for some changes to adapt them to the climatic conditions of the study area. The first calculation was carried out by applying the standard method obtaining a sediment production estimation of 21,821.6 m 3 /year for the whole catchment area. The second computation was performed by using the "squared cell" method (using 250 × 250m cell), in order to obtain the distribution maps of Gavrilović parameters and that of sediment production estimation (Figure 8).
The parameters X, Y and φ were obtained through the following equation for both the standard and the squared cell methods:   Table 2. Coefficient values for soil resistance, soil use and geomorphology used for the estimation of sediment production in the Savuto Lake catchment.

Soil Use (X). Value
Land ( The multiplicative values (Table 3) used to calculate the sediment volume through the Equations (1)-(3) were calculated taking into account the values proposed by [28] and allowing for some changes to adapt them to the climatic conditions of the study area.

Discussion
GIS plays a key role in the execution of algorithms allowing us to solve complex spatially distributed mathematical equations of models such as the EPM. Using the Python programming language, we were able to add new features useful to customize EPM application by means of QGIS software.
The EPM application requires a series of geoprocessing operations on both vector and raster layers before reaching the final calculation. For example, in order to obtain the slope map required during stage 1, the user needs to: (i) clip the DEM; (ii) extract slope values from clipped DEM; (iii) reclassify slope map; (iv) export raster to vector; (v) erase landslides area and rivers buffer from slope vector map; (vi) insert a field in the vector table to fill in with relative parameters. Using the PyQGIS plug-in, all the mentioned geoprocessing operations are automatically and quickly carried out. For instance, the Savuto Lake application required about 18 and 1 h without and with the use of the plug-in, respectively. In addition, the use of GIS interface allows an easy calibration and validation by using direct measurements of sediments accumulation in a closed basin (e.g., a lake) and/or the comparison with other semiquantitative estimation of soils erosion.
The EPM analysis provided an estimation of the sediments production in the whole river catchment area but it does not show the sectors characterized by higher and lower production. For this reason, we introduced a new calculation method based on the subdivision of the river catchment area in a gridded matrix with cell size of 250 m. The "squared cell" model performs the calculation by the algorithm iteration in each cell; the result is a new information representing the spatial distribution of the estimated sediments production. Moreover, the representation of the cells by QGIS graphical interface eases the representation of the spatial distribution for the sediments production values expressed in m 3 /year for each cell. Considering several tests for different catchment areas, we compared the sediments production values obtained both with standard and "squared cell" method ( Figure 1). The results derived by "squared cell" method are 10% lower than the results obtained with the standard one. This difference is due to the smaller area involved in the cells method calculation along the catchment perimeter.
The plug-in and the "squared cell" model were calibrated using a small artificial lake located in the upstream sector of the Savuto River (Sila Massif, middle Calabria). The application of the "squared cell" model allowed us to recognize cells with anomalous values of sediments production (e.g., cells located very close to the dam) and to exclude them from the total calculation.
The use of the plug-in for the estimation and spatial visualization of the sediments productions allows a fast and highly detailed (depending on the quality of the input data) identification of critical sites at the scale of basin, worth further and more detailed investigations. This information can be used in the medium-short time (>1 year) for planning the use of soil, the management of dikes and river sediments for beach nourishment and also for the mitigation of hydrogeological and coastal risks.
The plug-in YES is an experimental software which we are testing in different catchments of Mediterranean and Alpine area and South America. Currently, an applied study is in progress in Sardinia Region (Italy) as well as the MAREGOT Project [44] in collaboration with ARPA Sardegna. Table 4 shows the results of the estimation of sediment production comparing the standard model and squared cell one in some river catchments within the Italian territory. At present, we are working on the development of web service and databases of the parameters (geology, geomorphology, soil use, rain, temperature, drainage network) acquired by integration of traditional and innovative tools (remote sensing; weathering, sedimentological and geomorphological studies; geomechanical petrographic-mineralogical, textural analyses) and vectorized by GIS-procedure in several projects (e.g., VEROCOST and SMORI POR projects [45,46]), necessary to achieve a high resolution of input data required by plug-in YES. The web service will allow researchers to simplify the plug-in use to encourage the collaboration with university and EPM, making it attractive for public authorities and freelance professionals.

Final Remarks
The estimation of sediment production in river catchments represents a basic topic in many fields of application such as management of coastal erosion, hydrological risk analysis, prediction of the dams siltation, etc.
Starting from the existing semiquantitative methods for assessing erosion and sediment yield at the catchment scale, mainly the EPM method by [12], we developed the PyQGIS YES plug-in which simplifies and speeds up the EPM application. Thanks to the automated geoprocessing operations of the needed layers (e.g., geological and soil use maps), the plugin allows one to decrease the calculation time of 90%. Furthermore, using YES plug-in it is possible to not use average values of rainfall and temperature for the whole catchment but to consider its variation depending on the altitude and consequently to refine the final calculation. A great innovation of the YES plug-in "squared cell" is the possibility to obtain a map of erosion and sediment production which can be very useful for, e.g., identifying areas which need hydrogeological arrangement.
Finally, the new tool we developed would bring added value to facilitate the application of the EPM method, providing quickly useful information for the calibration and validation processes of the catchment area investigated. Furthermore, the improvement of the plug-in presented in this work, compared to the classic Gavrilovic method, is that it also provides a quantitative measure of the potential soil loss of the areas inside the catchment area.