# Development of Open-Source Tools for Event-Based Hydrological Modelling Using GIS and Python
## 3 Results and Discussion  
### GIS-Based Processes  
#### 3.1.1 Catchment Delineation  
We delineated the basins from the point where the water level gauge was placed. Figure 4 presents the QGIS flowchart displaying the processes and files involved.  
Figure 4: QGIS model 1. Catchment delimitation (representing yellow boxes represent the model inputs, white boxes indicate the functions utilised to process these inputs, and green boxes show the model outputs). The screenshot was obtained from the QGIS software (QGIS Development Team, 2024).  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Cathment** & **z Max** & **z Min** & **Channel** & **Cathment** \\  & **(masl)** & **(masl)** & **Length** & **Area** \\ \hline Pancrudo at Navarrete & 1301.75 & 899.522 & 46,608.72 & 381,876,679 \\ Rudron at Valdelateja & 971.635 & 651.205 & 50,960.24 & 505,378,148 \\ Sangues at Onsella & 1104.98 & 408.293 & 57,150.27 & 233,627,436 \\ Subialde at Larrinoa & 976.08 & 593.27 & 9730.708 & 21,360,782 \\ Tiron at SanMiguelPedroso & 1943.81 & 805.105 & 27,491.29 & 190,327,545 \\ Trueba at MedinaDePomar & 1361.59 & 578.945 & 53,004.09 & 468,549,100 \\ Ubagua at Riezu & 1212.42 & 491.038 & 91,333.75 & 35,536,916 \\ Urederra at Barindano & 736.78 & 500.118 & 6083.276 & 37,063,648 \\ Urirobi at Espinal & 1347.52 & 856.52 & 11,611.5 & 4,846,596 \\ Vallfarrera at Alins & 2601.49 & 1071.4 & 20,319.19 & 82,741,803 \\ Veral at Zuriza & 2093.41 & 1188.19 & 12,843.68 & 46,176,842 \\ Zatoya at Ochagavia & 1175.03 & 789.745 & 20,686.8 & 72,702,728 \\ Zidacos at Garinoian & 636.188 & 485.35 & 7164.723 & 27,097,980 \\ \hline \hline \end{tabular}
\end{table}
Table 2: _Cont._  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Material** & **Pixel Resolution** \\ \hline Digital elevation model (DEM) & 5 m \\ SoilGrids: silt, sand, clay and bulk density & 250 m \\ Spanish Land Use System (SIOSE) & Polygon shapefile \\  & (minimum polygon size: 1 m\({}^{2}\)). \\ \hline \hline \end{tabular}
\end{table}
Table 3: GIS data sources and spatial resolution.  
The combination of the QGIS GRASS r.watershed and r.water.outlet toolbox algorithms enabled the definition of the catchment boundaries. We first ran the r.watershed tool using the DEM, setting the minimum watershed basin size equal to the DEM pixel size. From the catchment's downstream endpoint (manually defined using the stream segments layer generated by r.watershed), the tool delineated the catchment boundaries based on the drainage direction layer produced by r.watershed. We used a DEM provided by the Spanish National Geography Institute (Instituto Geografico Nacional, 2023) with a spatial resolution of 2 m. Figure 5 presents the parameter tuning used for both processes, while Figure 6 shows the resulting outputs.  
Computing time became a relevant concern when using large DEM extents with a small pixel size. We obtained the coordinates of the water level gauging point and the  
Figure 5: Setup for r.watershed and r.water.outlet algorithms. The screenshot was obtained from the QGIS software (QGIS Development Team, 2024).  
Figure 6: GRASS r.water tool outputs (images retrieved from the Spanish national mapping provider, Instituto Geografico Nacional at [[https://centrodedescargas.cnig.es/CentroDescargas/index.jsp#](https://centrodedescargas.cnig.es/CentroDescargas/index.jsp#)]([https://centrodedescargas.cnig.es/CentroDescargas/index.jsp#](https://centrodedescargas.cnig.es/CentroDescargas/index.jsp#)), accessed on 10 July 2025).  
DEM from different sources, which introduced spatial inconsistencies, as the gauging point was occasionally located far from the stream segment. This required us to manually define the catchment outlet point (see Figure 7). Additionally, we encountered several issues when exporting the data to raster layers, as empty raster files were occasionally generated during the modelling process. This likely resulted from corrupted internal routines, as the issue occurred randomly without an apparent cause.