flowchart LR a["Route links"] --> b["junctionify<br>merge shared parts<br>of links"] b --> c["tidy_layout"]
Layout
Ribasim does not use the location of nodes and the geometry of links in the simulation. But a model that follows the real water system is much easier to review, on the map and in the model viewer, so the regional models and the coupled model get a shared layout step. None of this changes the results.
Routing the links
At the end of the forcing stage, ribasim_nl.network_snapping.snap_model aligns the layout of the level controlled models with the hydro-objects in verwerkt/profielen/network.gpkg, which are written by the profile generation:
- Connector nodes stay at the location of the structure they represent.
- Basin nodes are moved onto the nearest main route of the longest connected part of the hydro-objects in their basin, as in the gravity controlled models.
- Links between a Basin and a connector node follow the hydro-objects, complemented by the Top10NL water lines. Hydro-objects are only connected where there is evidence: the culverts (
duikersifonhevel) of the crossings data, gaps of at most 2 m, and gaps across BGT water surfaces. Connector nodes far from the hydro-objects are connected over the BGT water surfaces, crossing at most 100 m of land. - Links stay straight if no such route is found, or if it is not less than
ribasim_nl.link_geometries.MAX_STRAIGHT_LINE_RATIOtimes longer than the straight line, the same threshold as for the gravity controlled models.
In the gravity controlled models, snap_to_waterways routes the links that are still straight along the Top10NL waterways, at the end of their dynamic stage.
Tidying
ribasim_nl.junctionify merges the shared parts of links into Junctions, and ribasim_nl.layout.tidy_layout makes sure no nodes are on top of each other and no links overlap:
- Bergend Basins are placed 100 m from their doorgaand Basin.
- Links are offset 5 m to the right of their direction, so inflows and outflows along the same waterway are drawn side by side.
- Nodes that are still within 10 m of each other are moved apart.
The gravity controlled models get the same layout step at the end of their dynamic stage, and ribasim_nl.validation.validate_model checks it. The coupling tidies the links between models in the same way, and first rebuilds the routes of the Basins of Rijkswaterstaat along Top10NL.

