Monday 1 May 2017

raster - Calculating distance to points in QGIS


Is there a way of calculating the distance to the nearest points in QGIS? In ArcGIS there is a function called Euclidean Distance, which can take an input vector or raster, and generate a raster of distances.


enter image description here


Is there a similar function in QGIS? I could not find one in the documentation. I did explore the Raster functions in QGIS, and also the Hub Distance calculation fromMMGIS (for a non-raster solution) but I was not able to figure out how do this using either. If a vector approach is the only solution, that could be fine also.



Answer



First, rasterize your vector layer. You can do it using Rasterize under Raster menu.


Before rasterizing, I'd recommend to create an additional field and fill it with '1' and then select this field when rasterizing.


Second, Raster\Analysis\Proximity


Note that you should have GDALTools turned on in plugins.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...