3D with QGIS and Aerialod

4. Calculate Distance to River

In this section we'll calculate the distance to the river cells. We'll not calculate the Euclidean distance, but the distance over the flow direction, which is more realistic for runoff.

We'll use the ldddist tool from the PCRaster Tools plugin. This tool needs a friction layer. We'll create a friction layer with cells that have a value of 1. In that way the calculated distances are in map units.

1. In the Processing Toolbox go to PCRaster | Data management | spatial.

2. In the Spatial dialog type value 1 for the Input nonspatial. Choose Scalar for Output data type, because the friction layer should be in the scalar data type. For the Mask layer choose again any of the PCRaster layers. Save the result to friction.map.


3. Click Run. Click Close after processing.

Now we can calculate the distance to the rivers.

4. In the Processing Toolbox go to PCRaster | Hydrological and material transport operations | ldddist.

5. In the Ldddist dialog choose flowdirection as LDD layer, rivers for Cells to which distance is calculated (Boolean), friction for the Friction layer and save the result as distance.map.

6. Click Run. Click Close after processing.

Now we have for each cell the distance to the river in meters visualized in grayscale.

In the next section we'll finalize the inputs for Aerialod.