<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16535"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>Margherita,</FONT></DIV>
<DIV><FONT face=Calibri>now I got your point...I had a very similar problem a
short time ago, but finally I was able to solve it. If your are interested
in, take a look to the following notes - I know, a bit complicated but it works
<IMG style="POSITION: static; MARGIN: 0px; FLOAT: none"
title="Zwinkerndes Smiley Emoticon" tabIndex=-1
alt="Zwinkerndes Smiley Emoticon"
src="cid:7DB8DBAC31E94AD7869AE9C8F802551F@chrislaptop"
MSNNonUserImageOrEmoticon="true"></FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>- set your desired path as a mask for limiting following
calculations using r.mask</FONT></DIV>
<DIV><FONT face=Calibri>- r.describe -dr <your_dem> to fetch min and max
of elevation along your path (use tool awk or any other string
processing function like split() in Python) </FONT></DIV>
<DIV><FONT face=Calibri>- r.to.vect to convert the mask into a vector line, and
then v.to.db -p <your_vector_path> option=length column=s to print out the
path length (therefor, parse the string again to fetch the column that contains
the length)</FONT></DIV>
<DIV><FONT face=Calibri>- now you can calculate the slope based on altitude
difference and distance...</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Perhaps it is adaptable to yours...</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Christian.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT size=3 face=Calibri></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title="mailto:diregola@gmail.com STRG + Klicken, um Verknüpfung zu folgen"
href="mailto:diregola@gmail.com">Margherita Di Leo</A> </DIV>
<DIV><B>Sent:</B> Wednesday, June 02, 2010 6:50 PM</DIV>
<DIV><B>To:</B> <A
title="mailto:christian.schwartze@uni-jena.de STRG + Klicken, um Verknüpfung zu folgen"
href="mailto:christian.schwartze@uni-jena.de">Christian Schwartze</A> </DIV>
<DIV><B>Cc:</B> <A
title="mailto:grass-user@lists.osgeo.org STRG + Klicken, um Verknüpfung zu folgen"
href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</A> </DIV>
<DIV><B>Subject:</B> Re: [GRASS-user] get coords from a raster</DIV></DIV></DIV>
<DIV><BR></DIV>Christian,<BR><BR>thank you for answering. My problem is that I
don't want to use the slope map to get slope, bu i want to calculate it as the
<BR>ratio between the difference of the elevation and the distance between two
given points (pixels). To do that, I need to get the coordinates of the points
as a input file for r.profile.<BR><BR>Margherita<BR><BR><BR>
<DIV class=gmail_quote>2010/6/2 Christian Schwartze <SPAN dir=ltr><<A
title="mailto:christian.schwartze@uni-jena.de STRG + Klicken, um Verknüpfung zu folgen"
href="mailto:christian.schwartze@uni-jena.de">christian.schwartze@uni-jena.de</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT face=Calibri>Why are you not using r.statistics, since it takes one
base map (your path as a raster) and another map containing data you want to
analyze (your slope). With the "average" option/method you will get
the desired result, if I understand you correctly...</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Christian.</FONT></DIV>
<DIV style="FONT: 10pt Tahoma; font-size-adjust: none; font-stretch: normal">
<DIV><BR></DIV>
<DIV
style="BACKGROUND: rgb(245,245,245); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
<DIV><B>From:</B> <A
title="mailto:diregola@gmail.com STRG + Klicken, um Verknüpfung zu folgen"
href="mailto:diregola@gmail.com" target=_blank>Margherita Di Leo</A> </DIV>
<DIV><B>Sent:</B> Wednesday, June 02, 2010 6:17 PM</DIV>
<DIV><B>To:</B> <A
title="mailto:grass-user@lists.osgeo.org STRG + Klicken, um Verknüpfung zu folgen"
href="mailto:grass-user@lists.osgeo.org"
target=_blank>grass-user@lists.osgeo.org</A> </DIV>
<DIV><B>Subject:</B> [GRASS-user] get coords from a raster</DIV></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV><BR></DIV>Hi List,<BR><BR>I'm trying to make a script to calculate the
slope along a path. I want to calculate the slope as the average of cell per
cell slope. For my purpose I found r.profile to produce the input file for my
script, but I have to give it the coordinates of the points. As I have a
raster and not a vector, I was wondering if is there a non interactive way
like a d.where or something like that, that i can use for my purpose. I mean,
i have a raster in which there is the path i'm interested in, and the other
cells are null.<BR><BR>Thank you in advance<BR><BR>Margherita<BR></DIV></DIV>
<P></P>
<HR>
<P></P>_______________________________________________<BR>grass-user mailing
list<BR><A href="mailto:grass-user@lists.osgeo.org"
target=_blank>grass-user@lists.osgeo.org</A><BR><A
href="http://lists.osgeo.org/mailman/listinfo/grass-user"
target=_blank>http://lists.osgeo.org/mailman/listinfo/grass-user</A><BR></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>