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

Francisco Calzada paco.calzada2000 at gmail.com
Fri Jun 3 04:50:18 EDT 2011


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 at osgeo.org>
>
> On Wed, Jun 1, 2011 at 10:02 PM, Francisco Calzada
> <paco.calzada2000 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20110603/5538d7e6/attachment.html


More information about the grass-user mailing list