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.


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.

  • Thanks - that worked. In theory though, does it make a difference what the field value is?
    – djq
    Mar 12 '12 at 13:38
  • 1
    In order to rasterize, it seems there must be an existing raster on disk. How do you create that raster??? Feb 7 '13 at 15:54
  • QGIS 2.0 does't need an existing raster.
    – z0r
    Feb 4 '14 at 7:01
  • Hi Maxim, could you please explain why one needs an additional field with "1" values ? thanks Sep 15 '16 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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