I have two linear layers like you see below:
I would like to select just the nearest black lines to the red ones, which represent the other layer.
I found similar solutions, but they refer to the point layer instead:
Find nearest line feature from point in QGIS
Is there some way of making a selection of just these lines, which lie in the direct vicinity of the red line (another layer)?
UPDATE I:
The answer below brought me to the following approach:
the formula works, but I guess something is wrong with the Join by nearest option. I've set a unique id for both layers, one of them had already fid as the unique one. When the formula is applied, some parts of the layer are selected regardless of their vicinity to the other layer.
How should I do the Join by nearest option with respect to this situation?