"I would like to calculate the Euclidian distance from a residence to a public service of interest e.g. the distance from a residence to a green space (as the crow flies) in QGIS. After browsing the Internet it seems that I need to rasterize my vector before I can use the Proximity tool provided by GDAL. When I try to make the conversion from vector to raster my thought was to take the shp.file which contains the polygons. The function "rasterize" tells me to chose an "output file for rasterized vectors (raster)" but I have no idea what to chose here. Should I create a raster for this? And how do I this? I'm using QGIS 1.8 Mac and GDAL 1.9. Thanks in advance."

Ok, it seems like I have not done my homework good enough. Let me start over: I have a vector layer with points from which I want to calculate the distance to vector layers with lines or polygons. Still I want to calculate the Euclidian distance (as the crow flies) from the points in the first layer to the lines or polygons in the other layers: The distance from a residence (point) to a stream (line) or forest (polygon). Additionally, I would like to put the distances in the attribute table of the vector layer with points in a new column. Sorry for the inconvenience.

  • distance from a polygon is a very vague term. You want the distance of the point which is nearest?
    – Naresh
    Commented Mar 6, 2013 at 11:34
  • and i guess its not straight line, you need route distance?
    – Naresh
    Commented Mar 6, 2013 at 12:21
  • Why not extract the polygon nodes (with attribute) and then calculate the distance to the specified point. Regarding your rasterize-question: You rasterize your polygon (this is what the function does) and therefore you should specifiy an output folder
    – Curlew
    Commented Mar 6, 2013 at 13:06
  • as Curlew said, you need to specify size and seems like the plugin doesnt have all the functions so you have to do it using a command line (GDAL command line). You can get centroid of polygons by vector->geometry tool->polygon centroid and export it. Then you can do Vector->distance matrix. and it will give you distance in a matrix. Make sure you are in projected coordinate system.
    – Naresh
    Commented Mar 6, 2013 at 13:34
  • @Kasper please edit your original question from comments. Comments are designed to help make the question better or clarify.
    – Brad Nesom
    Commented Mar 6, 2013 at 14:16

1 Answer 1


Based on the second part of your question, you could calculate the distances between vector features (points, lines, polygons) in GRASS using the module v.distance

  • Thanks. I'm trying to use v.distance right now but I have some trouble with getting the calculation done. I have 130000+ of points, so it will take some time.
    – Kasper
    Commented Mar 7, 2013 at 11:32
  • which version of GRASS are you using?
    – dmci
    Commented Mar 7, 2013 at 13:38
  • Just out of curiosity, how long time does it normally take for v.distance to calculate the distance? My point layer contains over 130000 points and the line layer 90 and the session has lasted for over 40 min now...
    – Kasper
    Commented Mar 7, 2013 at 13:45
  • It is not clear which version of GRASS I'm using. I can't fint the info. I fetched it from the Plugin Manager.
    – Kasper
    Commented Mar 7, 2013 at 13:48
  • >grass --version
    – dmci
    Commented Mar 7, 2013 at 13:56

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.