I'm trying to write a script to calculate the least cost path between two cells on a raster. I'm reasonably familiar with the approaches used by tools such as GRASS GIS's
r.cost and ArcGIS's
CostDistance tools. However, there is one constraint I can't figure out how to include:
The path represents the route of a pipeline carrying water. An increase in elevation incurs a cost (due to the pumping required). However, for a given elevation this is a one-off cost. i.e. the pumping cost is only related to the height of the source and the single highest elevation the path travels through. If the path passes through a cell at 5m elevation, it doesn't cost anything to travel through any other cell at the elevation.
How could I go about incorporating this constraint in my analysis? I'm open to any solution, but preferably one that could be scripted (and extra points for free/open source!).