0

I'm a bit stuck on calculating distance between two polygon features (i.e. closest part of the polygon A to closest part of polygon B (not necessarily where the points are as sometimes a line between the points is closest).

I've figured out I need to convert the polygons to points so I've used 'points along geometry' to get points at 10m intervals along Polygon A and Polygon B's boundaries.

However, when I then try and pass these features through things like 'distance matrix' and 'shortest line between features' it gives me a measurement for nearest point in B for every point in Polygon A (resulting in over 9000 entries in the attribute table). I just need to know the distance between the closest Polygon A point and Polygon B point.

If it helps, I'm trying to find the distance between 30 Scheduled Monuments (Polygon A) and the Site Boundary (Polygon B).

I'm reasonably new to QGIS.

1
  • 1
    Are the polygons in the same layer or two different layers?
    – Bera
    Commented May 15 at 18:31

1 Answer 1

5

Leave your data as polygons. Use the "Shortest line between features" tool. If your polygons are both in the same layer, set "Maximum number of neighbors" parameter to 2 (otherwise you just get the distance between a polygon and itself, i.e 0). Select (or filter) for distances > 0.

enter image description here

enter image description here

enter image description here

3
  • Thanks - guessing I may want to get the polygons to break up into smaller vertices first? Is there an easy way to get QGIS to put more verticies along the polygon boundaries? Commented May 17 at 12:33
  • No. The tool will find the closest point from/to anywhere along the polygon border, which can be between vertices.
    – user2856
    Commented May 17 at 13:19
  • @sarchaeologist if this answered your question, please accept it so the question is marked as answered gis.stackexchange.com/help/someone-answers
    – user2856
    Commented May 29 at 9:18

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.