2

I have a layer of point data, and a layer that contains polygons of all the lakes in a region. I am trying to find the K closest of these lakes for each point. The distance should be measured from the point to the closest edge of each lake.

All solutions I have seen so far either can only connect a point to the centroid of the lake polygon, and can only make the closest connection (whereas I am trying to make K connections from each point to the closest lake polygons).

The tools I have tried to far:

  • "Join by lines (hub lines)" - this can only connect each point with its nearest single lake
  • GRASS v.distance tool - can only connect each point to 1 polygon

Below is an image of what I am trying to achieve (shown for a single point and for k=3).

Example of what I would like to achieve, where k=3

0

2 Answers 2

3

Very easy with Shortest line between features.

Points should be Input layer, and polygons Destination layer. Maximum number of neighbors=3.

THe output will be a line layer connecting each point the the closest three polygons. The line will have all point and polygon attributes from the two connected features, and a distance:

enter image description here

1

To get the nearest points go to Processing, search for Nearest, then Join attributes by nearest. You can then input your two vector layers and specify the max nearest neighbours to 3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.