If I have a r.cost surface calculated from a set of vector points used as starting points, and some cost surface, is there any way to easily retrieve the SOURCE vector ID that leads to the lowest cost to get to any cell in the raster? E.g. from a given point, where is the point that costs the least to get to?
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307
On Friday 29 February 2008, Jonathan Greenberg wrote:
If I have a r.cost surface calculated from a set of vector points used
as starting points, and some cost surface, is there any way to easily
retrieve the SOURCE vector ID that leads to the lowest cost to get to
any cell in the raster? E.g. from a given point, where is the point
that costs the least to get to?
--j
r.cost is generally used in conjunction with r.drain.
First a cost surface from:
- a starting point
- a set of starting points
- a line segment
is generated to:
- the edges of the region
- a stopping point
- a set of stopping points
Then r.drain is used to compute the least-cost-path between the starting
point/points/line and some arbitrary end point. With the idea that you
will "drain" some water down-slope the cost surface, back to your starting
point/points/line.
To find the least-cost-path between *any two points* I have generally found it
simplest to run r.cost + r.drain for every start/stop combination that I am
interested in. An example is posted here:
If I have a r.cost surface calculated from a set of vector points
used as starting points, and some cost surface, is there any way to
easily retrieve the SOURCE vector ID that leads to the lowest cost
to get to any cell in the raster? E.g. from a given point, where
is the point that costs the least to get to?
As Dylan wrote, r.drain should help find the path to the nearest pit.
Other water flow modules may help too.
Hamish
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
If I have a r.cost surface calculated from a set of vector points
used as starting points, and some cost surface, is there any way to
easily retrieve the SOURCE vector ID that leads to the lowest cost
to get to any cell in the raster? E.g. from a given point, where
is the point that costs the least to get to?