[GRASS-user] Shortest path for a new road

Hi!

I need to create a plan for a new road from a known source point, to a known destination area. I have a grid of elevation and land use for the region. So from that I can calculate a cost weight using r.walk or r.cost Now by using this I'd like to calculate a new raster or vector which would show the least cost path from source to destination.

Is this possible? I know that with Arc/Info I can use the Spatial Analyst to do this, but I'd like to be able to do it with GRASS. Any ideas?

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>

On Friday 26 January 2007 03:12, Wolf Bergenheim wrote:

Hi!

I need to create a plan for a new road from a known source point, to a
known destination area. I have a grid of elevation and land use for the
region. So from that I can calculate a cost weight using r.walk or
r.cost Now by using this I'd like to calculate a new raster or vector
which would show the least cost path from source to destination.

Is this possible? I know that with Arc/Info I can use the Spatial
Analyst to do this, but I'd like to be able to do it with GRASS. Any ideas?

--Wolf

Hi Wolf,

The usual approach in GRASS for this type of problem is:

1. define cost surface (slope is commonly used) but a distance map would work
as well (r.mapcalc "dist = 1")

2. create cumulative cost map (r.cost) along with the cost surface from step 1

3. simulate a drop of water 'draining' from some destination to the point of
least cost (your starting point) (r.drain)

4. use r.to.vect to vectorize the output from r.drain.

rather verbose example here:
http://casoilresource.lawr.ucdavis.edu/drupal/node/244

Cheers,

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

Use r.drain with your cost surface (made from the destination point) and the
source point.

Michael

On 1/26/07 4:12 AM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

Hi!

I need to create a plan for a new road from a known source point, to a
known destination area. I have a grid of elevation and land use for the
region. So from that I can calculate a cost weight using r.walk or
r.cost Now by using this I'd like to calculate a new raster or vector
which would show the least cost path from source to destination.

Is this possible? I know that with Arc/Info I can use the Spatial
Analyst to do this, but I'd like to be able to do it with GRASS. Any ideas?

--Wolf

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Dylan Beaudette wrote:

Hi Wolf,

The usual approach in GRASS for this type of problem is:

1. define cost surface (slope is commonly used) but a distance map would work as well (r.mapcalc "dist = 1")

I ended up using slope + some other costs added with r.mapcalc to a cost surface.

2. create cumulative cost map (r.cost) along with the cost surface from step 1

This was the crucial step that I had somehow missed. Thank you very much! You have made me a very happy man!

--Wolf

--

<:3 )---- Wolf Bergenheim ----( 8:>

Wolf Bergenheim wrote:
> I need to create a plan for a new road from a known source point, to
> a known destination area. I have a grid of elevation and land use
> for the region.

Dylan Beaudette wrote:

The usual approach in GRASS for this type of problem is:

1. define cost surface (slope is commonly used) but a distance map
would work as well (r.mapcalc "dist = 1")

2. create cumulative cost map (r.cost) along with the cost surface
from step 1

3. simulate a drop of water 'draining' from some destination to the
point of least cost (your starting point) (r.drain)

4. use r.to.vect to vectorize the output from r.drain.

rather verbose example here:
http://casoilresource.lawr.ucdavis.edu/drupal/node/244

see also the "GRASS Seeds" Leicester raster tutorial for an example.
  http://grass.itc.it/gdp/tutorials.php

Hamish