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

2011-06-03 Thread Francisco Calzada
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 
>
> On Wed, Jun 1, 2011 at 10:02 PM, Francisco Calzada
>  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
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2011-06-01 Thread Markus Neteler
On Wed, Jun 1, 2011 at 10:02 PM, Francisco Calzada
 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
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2011-06-01 Thread Francisco Calzada
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!!!
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2011-05-31 Thread Dylan Beaudette
On Tue, May 31, 2011 at 8:54 AM, Markus Neteler  wrote:
> On Tue, May 31, 2011 at 9:22 AM, Francisco Calzada
>  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
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2011-05-31 Thread Markus Neteler
On Tue, May 31, 2011 at 9:22 AM, Francisco Calzada
 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
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2011-05-31 Thread Francisco Calzada
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
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user