[GIS] QGIS _Distance from point to polygon- doubt

distancemmqgisqgis

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?

Best Answer

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)