Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

"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.

share|improve this question
    
distance from a polygon is a very vague term. You want the distance of the point which is nearest? –  Naresh Mar 6 '13 at 11:34
    
and i guess its not straight line, you need route distance? –  Naresh Mar 6 '13 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 Mar 6 '13 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 Mar 6 '13 at 13:34
    
@Kasper please edit your original question from comments. Comments are designed to help make the question better or clarify. –  Brad Nesom Mar 6 '13 at 14:16
show 3 more comments

1 Answer

up vote 0 down vote accepted

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

share|improve this answer
    
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 Mar 7 '13 at 11:32
    
which version of GRASS are you using? –  dmci Mar 7 '13 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 Mar 7 '13 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 Mar 7 '13 at 13:48
    
>grass --version –  dmci Mar 7 '13 at 13:56
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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