On the picture below, I want to let my point connect to the line with the shortest distance and show the distance to me.
I tried NNjoin, MMQGIS, v.distance But I still can't get the distance.
How do I connect them and get the shortest distance?
After that, I used the field calculator, but I think the distance is wrong
I measured it by myself, is any details can tell me to calculate the distance?
Best Answer
It is possible to create a line that joins points and line using the Geometry generator.
In the point layer symbology, select the Geometry generator and use this expression to create the shortest line between the two geometries
To know the distance between the two geometries, AKA the length of the shortest line, you can use this expression in the label expressions or use it in the Field calculator to create a new field with this information