4

How do I measure the distance between all points in a vector layer and a polygon (not to the polygon centroid, but to it's border line)?

In the image points are fires and the polygon is a National Park. I need to measure how far is each fire from the park's border.

enter image description here

2
5

Finding the point distance to the boundary of a polygon for points that are inside can't be done directly as the proximity tool evaluates the distance from point to polygon as 0. To find the shortest distance of a point inside a polygon to its boundary degenerate the polygon to its bounding line, this link is different to the comment and has nice pictures.

After the polygon is reduced to its bounding line the distance can be calculated with v.distance and probably using NNJoin as you say but I can't attest to that having not used the NNJoin tool (yet).

1

You can also use saga snap point to line (processing). That gives you the option on moving the point or producing a line. That line however will not be snapped because of float point errors but the distance will be good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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