[GRASS-user] Elevation differences between endpoints of least cost paths
MacQueen, Don
macqueen1 at llnl.gov
Mon Mar 24 07:22:01 PDT 2014
Thank you!
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
From: jctorres <jctorres at ugr.es<mailto:jctorres at ugr.es>>
Date: Saturday, March 22, 2014 12:04 AM
To: "MacQueen, Don" <macqueen1 at llnl.gov<mailto:macqueen1 at llnl.gov>>, "grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>" <grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>>
Subject: Re: [GRASS-user] Elevation differences between endpoints of least cost paths
Hi Don
I think you can solve this using grass 7 (you can download it from http://grass.osgeo.org/download/software/). This version includes a new option for r.cost that copies the value of the nearest cell. You can solve the problem using
r.mapcalc "streamH=if(isnull(stream.thin),null(),FD)"
r.cost -k input=area.one output=dtv start_rast=streamH nearest=nearestH
nearestH will contains the elevation of the nearest stream
Best regards
--
=======================================================================
Juan Carlos Torres | http://lsi.ugr.es/~jctorres<http://lsi.ugr.es/%7Ejctorres>
Laboratorio de Realidad Virtual | Tlf.: (+34) 645 885 167
Dpto. Lenguajes y Sistemas Informaticos | (+34) 958 249 307
ETS. Ing. Informatica | interno ugr 71 260
Univ. de Granada | FAX: (+34) 958 243 179
=======================================================================
El 21/03/14 23:47, MacQueen, Don escribió:
I'm stating with a DEM (named FD).
First I find streams:
r.watershed elevation=FD stream=stream
r.thin input=stream output=stream.thin
Then, for each point on the DEM, I need
The distance to the nearest point in a stream
The elevation difference to the stream point
I can get the distance by gollowing the example "Computing a distance map"
in Neteler & Mitasova's GRASS book:
r.mapcalc area.one=1
r.cost -k input=area.one output=dtv start_rast=stream.thin
So far so good, and the results make sense
But I would very much appreciate suggestions for the elevation difference.
I have been looking at various r.* routines, such as r.drain, but haven't
yet found a solution. I have very little experience with raster analysis.
(and in fact, I'm using the R package spgrass6 to manage the above steps)
Thanks
-Don
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140324/e2a8f0aa/attachment.html>
More information about the grass-user
mailing list