In my project I try to find the shortest way from a point to a specific line (street). Fortunately, this is no big deal in QGIS 3.0 using "Points along lines" and "Distance to Nearest Hub (Line)". But if not the street but another point on the same layer is closer, I would like to connect to the nearest point on the same layer. (A little tolerance to prefer the connection to the street would be ideal)
So this is what is now:
This would help me a lot
One of the difficulties I'm struggling with is to find the nearest point on the same layer (and draw a line to it). A solution for that as a first step would be very helpful, too.
overlay_nearest
function to get the closest point on the same layer:overlay_nearest (@layer, $geometry)
. Also have a look atclosest_point(geometry1,geometry2)
to get the point on geometry1 that is closest to geometry2.