In three steps:
(1) Create 20m line segments
Line segments +20/-20 meters from the crossing point is generated by
Service area (from layer) tool (
Processing Toolbox | Network analysis)
- Path type to calculate: Shortest
- Travel Cost: 20m
then Multipart to singleparts (
Processing Toolbox | Vector geometry) to split upstream/downstream segments.
(2) Create Slope layer
Go to menu
Raster | Analysis | Slope
(3) Calculate average of Slope value along the streams
Use Add raster values to features (in
SAGA | Vector <-> raster) on
Slope raster and
20m line (i.e.
Single part layer from the Step 1). It will automatically calculate average of the Slope along the stream.