Concepts

Least-cost path & global optimality

Why the route is the globally optimal corridor, not a greedy guess.

Given the cost surface, the optimal route is the path that minimises the accumulated cell cost from origin to destination:

P=arg minPkPCcell(k)P^{*} = \operatorname*{arg\,min}_{P} \sum_{k \in P} C_{\text{cell}}(k)

CO2GIS computes this with a chain of GRASS GIS algorithms, run through QGIS Processing.

The GRASS chain

StepAlgorithmWhat it does
1r.costPropagates the accumulated minimum cost from the origin across the whole cost surface (a raster Dijkstra). Also emits a movement-direction surface. Diagonal moves are allowed for better geometric fidelity.
2r.drainBack-traces from the destination, following the descending gradient of the accumulated-cost surface back to the origin → a path raster.
3r.thinReduces the path to unit width, so it has clean line topology.
4r.to.vectConverts the thinned path raster into a line vector for display and for CAPEX.

Why it’s globally optimal

r.cost computes the true accumulated-cost value for every cell, considering all ways of reaching it — not just local neighbours. Because the full surface is solved first, r.drain recovers the globally optimal corridor, not a greedy local path that can get trapped by nearby cheap cells.

The route minimises cost, not distance. It will happily take a longer geometric path if that avoids expensive terrain — which is exactly the point.

Next: see how the route is priced in The COMET cost model (the “same factors, twice” idea) and the per-tab LCP and Price Estimation pages.