[GIS] Distance between points and polygons in QGIS / PostGIS

distancepostgisqgis

I need to work out the distance between a table of polygons and a table of points.

The table of polygons has different site boundaries, and the point table has points relating to each of the site boundaries.

I need to work out the distance between each point and the site it relates to.

What is the best way to do this? Is this best done with a PostGIS query or is there a way to do it in QGIS (I notice there is distance matrix tool in QGIS but it doesn't support polygons). Ideally I would like a way to do this in QGIS as its something my users do quite regularly.

Best Answer

I would create a view in the database with the distance calculated.

Then you can open that view in QGIS and get your distances. When the tables changes the view will be updated.

/Nicklas

Related Question