I'm trying to do terrain analysis in QGIS.
I have a vector layer with equally spaced points along a slope, and these points are somewhat parallel to the coastline of a fjord:
I'm interested in finding the shortest path between each of these points and sea level (elevation = 0). Ideally, this would generate a new polyline layer with a bunch of straight lines between the red points and the ocean. In other words, I'm hoping to generate lines with the steepest overall slope that begin at each of the red circles.
To be clear, I'm not trying to do flow routing—these lines can go up and over bumps in the topography so long as they minimize the as-the-crow-flies distance between the points and sea level.
Any thoughts on how to accomplish this? I've found plenty of points about finding the shortest path between two points or between a point and a line layer, but nothing quite like this. One thought I had was generating closely-spaced lines along the shoreline and finding lines between my two point layers, but that seems a bit of a roundabout method. Plus, I'm not sure how to generate points along the shoreline without manually digitizing a line and creating points along it.
Edit: After finding some sources on how to connect points to a nearby line, this issue is more of a question of workflow: How to 1) Create some reference vector layer for the shoreline, and 2) How to find the shortest route between points and that vector layer. This process has been answered below by Tom Brennan.