1

I want to calculate the distance between a shp of points and a shp with a few polygons. I am using MMQGIS (Hub distances), a UTM coordinate system, and everything works fine, but I think it is giving me the distance from each point to the center of each polygon and, since the shp of the polygon represents water courses, I would like to obtain the distance of each point to the "surface" of the polygon.

Because there are points very close to the water but the distance I obtain is very far way.

Here: enter image description here

The yellow polygon represents almost the whole river, and there are points very cloe to the river but the distance I obtain is, for instance, 5 km.

How do I do solve this?

2

You are correct in that it calculates the distance between your points to the centroid of polygons/lines. You could:

  1. Convert your polygon to lines (Vector > Geometry Tools > Polygons to Lines)
  2. Convert your lines to points (Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points)
  3. Then run the Hub distances using your main points layer and the newly converted points layer

Or you could try using the GRASS tool v.distance (Processing Toolbox > GRASS commands > Vector > v.distance)

  • 1
    I used GRASS and it works very well, thank you very much! – mtao Jun 21 '16 at 11:10
  • @Teresa - Most welcome, glad it worked =) – Joseph Jun 21 '16 at 11:11

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.