<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>Thank you!</div>
<div>-Don</div>
<div><br>
</div>
<div>
<div>
<div>-- </div>
<div>Don MacQueen</div>
</div>
<div>Lawrence Livermore National Laboratory</div>
<div>7000 East Ave., L-627</div>
<div>Livermore, CA 94550</div>
<div>925-423-1062</div>
<div><br>
</div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>jctorres <<a href="mailto:jctorres@ugr.es">jctorres@ugr.es</a>><br>
<span style="font-weight:bold">Date: </span>Saturday, March 22, 2014 12:04 AM<br>
<span style="font-weight:bold">To: </span>"MacQueen, Don" <<a href="mailto:macqueen1@llnl.gov">macqueen1@llnl.gov</a>>, "<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>" <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [GRASS-user] Elevation differences between endpoints of least cost paths<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Don<br>
<br>
I think you can solve this using grass 7 (you can download it from <a class="moz-txt-link-freetext" href="http://grass.osgeo.org/download/software/">
http://grass.osgeo.org/download/software/</a>). This version includes a new option for r.cost that copies the value of the nearest cell. You can solve the problem using<br>
<br>
r.mapcalc "streamH=if(isnull(stream.thin),null(),FD)" <br>
<br>
r.cost -k input=area.one output=dtv start_rast=streamH nearest=nearestH <br>
<br>
nearestH will contains the elevation of the nearest stream<br>
<br>
Best regards<br>
<br>
<small><br>
<span class="moz-txt-tag">-- <br>
</span>======================================================================= <br>
Juan Carlos Torres | <a class="moz-txt-link-freetext" href="http://lsi.ugr.es/%7Ejctorres">
http://lsi.ugr.es/~jctorres</a> <br>
Laboratorio de Realidad Virtual | Tlf.: (+34) 645 885 167 <br>
Dpto. Lenguajes y Sistemas Informaticos | (+34) 958 249 307 <br>
ETS. Ing. Informatica | interno ugr 71 260 <br>
Univ. de Granada | FAX: (+34) 958 243 179 <br>
======================================================================= <br>
<br>
<br>
</small><br>
<br>
El 21/03/14 23:47, MacQueen, Don escribió:<br>
</div>
<blockquote cite="mid:CF520F93.F0B37%25macqueen1@llnl.gov" type="cite">
<pre wrap="">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
</pre>
</blockquote>
<br>
</div>
</div>
</blockquote>
</span>
</body>
</html>