flowchart LR bgt["BGT water surfaces"] --> width hydro["hydro-objects,<br>crossings"] --> paths["doorgaand or bergend,<br>by shortest paths"] paths --> width["Width from the<br>BGT surface"] width --> depth["Depth from hydrotype,<br>or measured"] xs["measured cross-sections"] --> depth depth --> ah["A(h) of doorgaand<br>and bergend"] ah --> model["Basin / profile,<br>storage Basins"]
Profile generation
The level controlled models get representative profiles of their water bodies in the profiles_<water board> stages. The profiles – represented by \(A(h)\)-relations – largely determine the retention time of water in a basin, where the distinction between doorgaand and bergend is crucial: doorgaand represents flowing water bodies, while bergend represents stagnant water bodies. This makes them mainly relevant for water quality simulations.
These profiles also form the basis for the coupling with the groundwater modelling, and their hydro-objects, verwerkt/profielen/network.gpkg, guide the layout of the model. The gravity controlled models get their profiles in other ways, see storage basins.
Profile generation workflow
Profiles are generated per water authority, as (1) data sources are available per water authority, and (2) data sources are formatted differently per water authority.
Prior to generating the profiles, the data is preprocessed:
- Preprocessing of data sources, which includes generating
LINESTRING Z-objects of measured cross-sections, sorting the hydro-objects and crossings by their geometry, so that the shortest paths, and with them the profiles, do not depend on the order of the rows, seepath_finder.canonical, removing duplicate hydro-objects, repairing hydro-objects along HyDAMO-standards, reading the current BGT water surfaces of the area from the nationaldata/Basisgegevens/BGT/bgt_water.parquet, seeribasim_nl.bgt_water.
Subsequently, the following steps are executed on a per-basin basis:
- Select relevant hydro-objects and crossings (i.e., within a basin). Hydro-objects count with their whole length in the basins they overlap by more than \(1\,\mathrm{mm}\), and not in those they only touch, see
path_finder.overlaps; - Generate graph (or network) from hydro-objects (using
networkx); - Determine the shortest path(s) between crossings, which separates the hydro-objects as doorgaand versus bergend;
- Couple BGT-polygons to hydro-objects (non-intersecting BGT-polygons will be classified as bergend at a later stage);
- Estimate representative width per hydro-object based on coupled BGT-polygon’s surface area and circumference;
- Estimate representative depth per hydro-object based on width and hydrotope (using a look-up table);
- Update representative depth of hydro-objects labelled as doorgaand using measured cross-sections, if available: the mean depth of the cross-sections they cross, below the target level of the peilgebied of each cross-section, the smallest where peilgebieden overlap. Bed levels outside \(-50\) to \(+50\,\mathrm{m}\) NAP are errors or no-data values, and are left out;
- Define a trapezoidal cross-sectional profile using the representative width and depth (and a slope of \(1:3\), default);
- Define the \(A(h)\)-relation for doorgaand and bergend separately using the length of the hydro-objects;
- Correct the \(A(h)\)-relation of bergend by including non-intersecting BGT-polygons’ surface areas (as preluded to in 5.);
- Write two basin profile tables with \(A(h)\)-relations: one for doorgaand, and one for bergend.
During model implementation, generated profiles whose maximum area is below \(100\,\mathrm{m^2}\) are discarded. Every retained profile area is then clamped to at least \(10\,\mathrm{m^2}\). If only one of the doorgaand or bergend profiles survives for a basin, it is used for the existing basin without adding a separate storing basin. When neither profile survives, the model receives a two-point fallback profile with an area of \(10\%\) of its basin polygon, subject to the \(10\,\mathrm{m^2}\) minimum, at both \(2\ \mathrm{m}\) below its target level and at its target level. If no storing basins remain, implementation still updates the existing basins’ profiles and leaves the network unchanged. This prevents dummy and very small generated profiles from reaching the solver.
Some water boards differ from these steps. Hollandse Delta and Scheldestromen flag a predefined main route, gen_profiles.flagged_hydro_objects, instead of searching shortest paths. Hollands Noorderkwartier has no measured cross-sections, and Rijnland overrides the depths of its water bodies.
Profile generation code
The source code is in src/ribasim_nl/ribasim_nl/profiles. The profiles_<water board> DVC stages run the two scripts, for instance:
pixi run dvc repro --pull --single-item profiles_delflandpipeline/prep_cross_sections.pypreprocesses the measured cross-sections intoLINESTRING Z-objects.pipeline/<water board>/02_profiles.pygenerates the profile tables, andimplement.set_basin_profilessets them in the model, and adds the storage Basins with their ManningResistances.
To run them yourself, per water authority, with the cross-sections first:
pixi run python pipeline/prep_cross_sections.py <water board>
pixi run python pipeline/<water board>/02_profiles.pyThe results are in verwerkt/profielen:
| File | Content |
|---|---|
network.gpkg |
The hydro-objects with their main-route, used for the layout. |
profielen_doorgaand.csv, profielen_bergend.csv |
The tables with the \(A(h)\)-relations. |
intermediate/lines_z.gpkg |
The preprocessed cross-sections. |
intermediate/int_output.gpkg |
For inspection: main-route, endpoints, bgt, hydro-objects, basin_profiles_doorgaand and basin_profiles_bergend. |
intermediate/graph.gpkg |
For inspection: the graph of the network. |
Only network.gpkg is an output of DVC, so the others are there after running the stage yourself.

