[GRASS-user] gradient (slope) of a road

Dear list,
I’m new to this list and I wonder if you could help me.
I need to calculate the gradient (slope) of a road. I have a fine DEM to do it. The problem is when I run r.slope.aspect the resulting slope map have extremelly and odd high values. I don’t know why. Do you? Anyway, could you tell me how do you calculate the slope of a road?
Thank you in advance.
Paco

On Tue, May 31, 2011 at 9:22 AM, Francisco Calzada
<paco.calzada2000@gmail.com> wrote:

Dear list,
I'm new to this list and I wonder if you could help me.

Welcome!

I need to calculate the gradient (slope) of a road. I have a fine DEM to do
it. The problem is when I run r.slope.aspect the resulting slope map have
extremelly and odd high values. I don't know why. Do you? Anyway, could you
tell me how do you calculate the slope of a road?

First use v.drape to drape the 2D road map over the DEM:
http://grass.osgeo.org/grass64/manuals/html64_user/v.drape.html

Then use the resulting 3D vector map to calculate the slope for
the vector segments using the "slope" method, results go into
the attribute table:
http://grass.osgeo.org/grass64/manuals/html64_user/v.to.db.html

Hope this helps
Markus

On Tue, May 31, 2011 at 8:54 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Tue, May 31, 2011 at 9:22 AM, Francisco Calzada
<paco.calzada2000@gmail.com> wrote:

Dear list,
I'm new to this list and I wonder if you could help me.

Welcome!

I need to calculate the gradient (slope) of a road. I have a fine DEM to do
it. The problem is when I run r.slope.aspect the resulting slope map have
extremelly and odd high values. I don't know why. Do you? Anyway, could you
tell me how do you calculate the slope of a road?

First use v.drape to drape the 2D road map over the DEM:
http://grass.osgeo.org/grass64/manuals/html64_user/v.drape.html

Then use the resulting 3D vector map to calculate the slope for
the vector segments using the "slope" method, results go into
the attribute table:
http://grass.osgeo.org/grass64/manuals/html64_user/v.to.db.html

Hope this helps
Markus

Markus' suggestion is the simplest. If you need more than slope,
consider densifying your line segments and sampling the raster of
interest along the new, shorter, segments. Here is the outline:

http://casoilresource.lawr.ucdavis.edu/drupal/node/698

Cheers,
Dylan

Thank you so much!!! Your answers were really useful.

Anyway, I would like to ask you:

a) the result of the option “slope” of v.to.db is expressed in degrees or in percent units?

b) if it is in degrees is there any easy way to change it to percent?

Once again, thank you very much!!!

On Wed, Jun 1, 2011 at 10:02 PM, Francisco Calzada
<paco.calzada2000@gmail.com> wrote:

Thank you so much!!! Your answers were really useful.

Anyway, I would like to ask you:

a) the result of the option “slope” of v.to.db is expressed in degrees or in
percent units?

b) if it is in degrees is there any easy way to change it to percent?

The formula is coded like this in C:

   slope = (Points->z[Points->n_points - 1] - Points->z[0]) / len;

Calculations on attributes can be done with v.db.update when not using
the DBF driver (but SQLite or other).

Markus

Once again thank you very much.
As far as I understood, the formula that you mentioned:

slope = (Points->z[Points->n_points - 1] - Points->z[0]) / len

gives the tangent of the slope, since

“(Points->z[Points->n_points - 1] – Points->z[0])”

gives the difference between the altitude values of the endpoints of a given line; in other words, it gives the “rise”. And,

“len”

is the length of the line.
So, if this is correct, to convert the result of this formula into percentage values we only have to multiply it by “100”, since

“slope in percent=tan*100”

For instance, a 11º slope is equivalent to a 19,44% slope because

“TAN 11º = 0,1944”, and, “0,1944*100=19,44”

In conclusion, if the option “slope” of “v.to.db” gives as a result “0,033” (a tangent value) it means that we have a “3,3%” slope.
Please, if I’m wrong in any one of these steps, please let me know…

Cheers!

2011/6/2 Markus Neteler <neteler@osgeo.org>

On Wed, Jun 1, 2011 at 10:02 PM, Francisco Calzada
<paco.calzada2000@gmail.com> wrote:

Thank you so much!!! Your answers were really useful.

Anyway, I would like to ask you:

a) the result of the option “slope” of v.to.db is expressed in degrees or in
percent units?

b) if it is in degrees is there any easy way to change it to percent?

The formula is coded like this in C:

slope = (Points->z[Points->n_points - 1] - Points->z[0]) / len;

Calculations on attributes can be done with v.db.update when not using
the DBF driver (but SQLite or other).

Markus