Finding the least cost path
Least cost path (LCP) analysis is the raster equivalent of network analysis, which is used to find the optimal path between two points in a raster. In this recipe, we'll perform LCP analysis on a digital elevation model (DEM).
Getting ready
You need to download the following DEM and extract the ZIP file to your qgis_data/rasters
directory: https://geospatialpython.googlecode.com/svn/lcp.zip
How to do it...
We will load our DEM and two shapefiles consisting of start and end points. Then, we'll use GRASS through the Processing Toolbox to create a cumulative cost layer that assigns a cost to each cell in a raster based on its elevation, the value of the other cells around it, and its distance to and from the end points.
Then, we'll use a SAGA processing algorithm to find the least cost path between two points. Finally, we'll load the output onto the map. To do this, we need to perform the following steps:
- First, we'll import the QGIS processing...