[GRASS-user] Cost Path

Hello list,

I have a raster obtained through r.mapcalc whose cells values represent friction or cost.
To finish my study I’m lacking one final step - calculate the least cost path!

How do I do it? I’ve tried r.cost but the result is not wat I expected - My desired output is just a line from A to B, crossing the least valued cells.

Thanks in advance,

Cheers,

André Mano


Associação Leonel Trindade
SOCIEDADE DE HISTÓRIA NATURAL

Apartado 25 2564-909 Torres Vedras Portugal
Sede e Biblioteca: rua Cavaleiros da Espora Dourada, 27A 2560 Torres Vedras

Laboratório de Paleontologia e Paleoecologia: Polígono Industrial do Alto do Ameal 2565-641 Ramalhal
http://alt-shn.blogspot.com
www.alt-shn.org

On 07/02/12 14:39, ALT SHN wrote:

Hello list,

I have a raster obtained through r.mapcalc whose cells values represent
friction or cost.

I suppose that is friction per cell.

To finish my study I'm lacking one final step - calculate the least cost
path!

How do I do it? I've tried r.cost but the result is not wat I expected -
My desired output is just a line from A to B, crossing the least valued
cells.

Use r.cost with the coordinate of (or the vector or raster file containing) A as start point. Then r.drain with B as starting point.

Moritz

I have resolved with:

r.walk -k elevation=your_dtm friction=your_friction output=walkout start_points=A stop_points=B

afterwards

r.drain -c input=walkout output=drainout vector_points=B

perhaps it is need a filling of the dtm and also of walkout map in order to avoid aq loop effect

All the best,
Roberto

2012/2/7 Moritz Lennert <mlennert@club.worldonline.be>

On 07/02/12 14:39, ALT SHN wrote:

Hello list,

I have a raster obtained through r.mapcalc whose cells values represent
friction or cost.

I suppose that is friction per cell.

To finish my study I’m lacking one final step - calculate the least cost
path!

How do I do it? I’ve tried r.cost but the result is not wat I expected -
My desired output is just a line from A to B, crossing the least valued
cells.

Use r.cost with the coordinate of (or the vector or raster file containing) A as start point. Then r.drain with B as starting point.

Moritz


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

@ Roberto

Thank you for the hint. It’s a nice way arround for a future purpose.

The friction map I am using was build from various inputs, one of them the DEM (slope). So, if I understood right, using r.walk would be redundant beacause slope and altitude are already considered in the friction map.

Best Regards,

André

2012/2/8 Roberto Marzocchi <roberto.marzocchi@gmail.com>

I have resolved with:

r.walk -k elevation=your_dtm friction=your_friction output=walkout start_points=A stop_points=B

afterwards

r.drain -c input=walkout output=drainout vector_points=B

perhaps it is need a filling of the dtm and also of walkout map in order to avoid aq loop effect

All the best,
Roberto

2012/2/7 Moritz Lennert <mlennert@club.worldonline.be>

On 07/02/12 14:39, ALT SHN wrote:

Hello list,

I have a raster obtained through r.mapcalc whose cells values represent
friction or cost.

I suppose that is friction per cell.

To finish my study I’m lacking one final step - calculate the least cost
path!

How do I do it? I’ve tried r.cost but the result is not wat I expected -
My desired output is just a line from A to B, crossing the least valued
cells.

Use r.cost with the coordinate of (or the vector or raster file containing) A as start point. Then r.drain with B as starting point.

Moritz


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Associação Leonel Trindade
SOCIEDADE DE HISTÓRIA NATURAL

Apartado 25 2564-909 Torres Vedras Portugal
Sede e Biblioteca: rua Cavaleiros da Espora Dourada, 27A 2560 Torres Vedras

Laboratório de Paleontologia e Paleoecologia: Polígono Industrial do Alto do Ameal 2565-641 Ramalhal
http://alt-shn.blogspot.com
www.alt-shn.org