Thank you everyone for your help. As always, GRASS offers many possibilities to do anything. I solved with r.out.xyz.
Best, Margherita 2010/6/3 Christian Schwartze <[email protected]> > Margherita, > 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 [image: > Zwinkerndes Smiley Emoticon] > > - set your desired path as a mask for limiting following calculations using > r.mask > - 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) > - 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) > - now you can calculate the slope based on altitude difference and > distance... > > Perhaps it is adaptable to yours... > > Christian. > > > *From:* Margherita Di Leo <[email protected]> > *Sent:* Wednesday, June 02, 2010 6:50 PM > *To:* Christian Schwartze <[email protected]> > *Cc:* [email protected] > *Subject:* Re: [GRASS-user] get coords from a raster > > Christian, > > 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 > 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. > > Margherita > > > 2010/6/2 Christian Schwartze <[email protected]> > >> 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... >> >> Christian. >> >> *From:* Margherita Di Leo <[email protected]> >> *Sent:* Wednesday, June 02, 2010 6:17 PM >> *To:* [email protected] >> *Subject:* [GRASS-user] get coords from a raster >> >> Hi List, >> >> 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. >> >> Thank you in advance >> >> Margherita >> >> ------------------------------ >> >> _______________________________________________ >> grass-user mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/grass-user >> > >
<<Emoticon3.gif>>
_______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
