[GRASS-user] v.dissolve and r.cost problems

Glynn Clements glynn at gclements.plus.com
Thu Apr 2 01:19:54 EDT 2009


Colin Nielsen wrote:

> Lastly, there seems to be a bug in r.cost that causes it to get
> confused on surfaces with lots of negative values (try running r.cost
> on a surface made by r.surf.fractal to see this). In these cases, I
> think it never finishes.

That makes sense. If a group of adjacent cells have negative cost, the
least-cost path will be the one which involves the most "laps" around
the negative-cost area. In such a situation, the shortest path between
two adjacent cells could be via a negative-cost area on the far side
of the map.

The entire notion of "least cost" is based upon the assumption that
the cost must always be non-negative.

If the cost map contains any negative values, it should either
generate a fatal error, or treat such cells as nulls (exclude them or
use the null_cost= value) and generate a warning.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list