In 2012 I published a post on mapping the then newly released Tirol river dataset.
In the comments, reader Michal Zimmermann asked:
Do you think it would be possible to create a river stream which gains width along its way? I mean rivers are usually much narrower on their beginnings, then their width increases and the estuary should be the widest part, right?
With the help of geometry generators, we can now achieve this look directly in QGIS:
In the river dataset published by the state of Tirol, all rivers are digitized in upstream direction. For this styling to work, it is necessary that the line direction is consistent throughout the whole dataset.
We use a geometry generator symbol layer to split the river geometry into its individual segments:
Then we can use the information about the total number of segments (accessible via the expression variable @geometry_part_count) and the individual segment’s number (@geometry_part_num) to calculate the segment’s line width.
The stroke width expression furthermore uses the river category (GEW_GRKL) to vary the line width depending on the category:
CASE WHEN "GEW_GRKL" = '< 10 km2 Fluss' THEN 0.2 WHEN "GEW_GRKL" = '10 km2 Fluss' THEN 0.4 WHEN "GEW_GRKL" = '100 km2 Fluss' THEN 0.6 WHEN "GEW_GRKL" = '1.000 km2 Fluss' THEN 0.8 ELSE 1.0 END * ( 1- ( @geometry_part_num / @geometry_part_count ))
If the rivers are digitized in downstream direction, you can simply remove the 1- term.