[GRASS-user] slope along defined section (e.g. road, stream,)

Hello,
I would like to get the slope of a defined section like a part of a river or
a road.

The only post dealing with such a idea was left unanswered:
[GRASSLIST:7280] Hazard Assessment
-
http://thread.gmane.org/gmane.comp.gis.grass.user/8702

My idea is the following:
1) define a starting vector point and a end vector point of a stream or road
section.
2) then run a module to calculate the slope along that section
3) add the slope to the attribute table of the stream/road vector

While point 1 and 2 are quite clear to me I would ask you for hints on how to
calulate the slope as lined out in point 2.
What I am looking into would be a slope version of d.measure...

To have an idea on what one could like to do with the results:
* Get a first estimate (based on DEM resolution) on hydraulic gradients in
rivers
* assess the risk of certain roads in mountainious regions

Thanks in advance for your help.

Kind regards,
Timmie

Tim Michelsen wrote:

I would like to get the slope of a defined section like a part of a
river or a road.

The only post dealing with such a idea was left unanswered:
[GRASSLIST:7280] Hazard Assessment
-
http://thread.gmane.org/gmane.comp.gis.grass.user/8702

My idea is the following:
1) define a starting vector point and a end vector point of a stream
or road section.
2) then run a module to calculate the slope along that section
3) add the slope to the attribute table of the stream/road vector

While point 1 and 2 are quite clear to me I would ask you for hints
on how to calulate the slope as lined out in point 2.
What I am looking into would be a slope version of d.measure...

To have an idea on what one could like to do with the results:
* Get a first estimate (based on DEM resolution) on hydraulic
gradients in rivers
* assess the risk of certain roads in mountainious regions

A line can only hold a single attribute for its totality, if you want
variable attributes along the line you have to break it up into finite
segments.

ideas-
method 1:
- r.slope.aspect to create slope map
- v.to.rast the vector line
- use r.mapcalc to get the intersection of the slope values and line
- r.univar, etc.

method 2:
break the line up into little segments and pull slope vales from a
raster map into those points.
- r.slope.aspect to create slope map
- v.to.points -i dmax=`g.region -g | grep res= ...`
   or v.lrs.segment
- v.db.addcol pointsmap column='DOUBLE slope'
- v.what.rast column=slope
- d.vect.thematic or 'd.vect.chart sizecol=slope' or 'd.vect wcolumn='

method 3:
instead of slope at points along line split line into many small
segments and find the slope for each segment. Otherwise v.to.db slope
just acts between end nodes of line for overall line slope. I think you
need a 3D vector line for this to work? (v.extrude?)
- v.split
- v.to.db option=slope

Dave wrote: (2 years, 32 weeks, 4 days, 14 hours and 6 minutes ago)

How can I extract the locations where the pipeline intersects the
streams?

v.patch + 'v.clean tool=break error=cross_points' ?

Hamish

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

Hi,

Tim Michelsen píše v St 06. 02. 2008 v 17:22 +0000:

Hello,
I would like to get the slope of a defined section like a part of a river or
a road.

The only post dealing with such a idea was left unanswered:
[GRASSLIST:7280] Hazard Assessment
-
http://thread.gmane.org/gmane.comp.gis.grass.user/8702

My idea is the following:
1) define a starting vector point and a end vector point of a stream or road
section.
2) then run a module to calculate the slope along that section
3) add the slope to the attribute table of the stream/road vector

While point 1 and 2 are quite clear to me I would ask you for hints on how to
calulate the slope as lined out in point 2.
What I am looking into would be a slope version of d.measure...

This is imho not so easy, how it looks. While vector lines are kind of
discrete objects (from node to node is one line), slope changes
continuously. The attribute of the slope will always have to be some
average along the line. You can cut the line e.g. every 200m, to fit it
better.

Anyway, with v.drape you can fit your vector network to digital
elevation model. With v.to.db you can store the length of the line and
it's nodes coordinates to the database and slope is
length/(end_node_z-start_node_z), which can be performed with db.execute

What more: I just find out, that v.to.db has an option "slope" as well -
no need to calculate it manually :slight_smile:

  Hope, it helps

Jachym

To have an idea on what one could like to do with the results:
* Get a first estimate (based on DEM resolution) on hydraulic gradients in
rivers
* assess the risk of certain roads in mountainious regions

Thanks in advance for your help.

Kind regards,
Timmie

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Jachym Cepicky
e-mail: jachym.cepicky@gmail.com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

On Wednesday 06 February 2008 18:22:12 Tim Michelsen wrote:

3) add the slope to the attribute table of the stream/road vector

I see the biggest problem in this part of your idea, since a spacially
extended feature (road or river in your case) simply cannot have one slope
value for its complete spatial course. More like the slope will change for
each cell of your slope raster map. So given your road is a vector you could
only apply one value for each section from node to node of your vector. Which
value should be taken or is a average value enough?

Why don't you just calculate a slope map for your required region and use
d.profile to see your slope values as a profile. Or you could use v.report to
see whats under your stream or road.
Just a few thoughts

Greetings Frank

Tim Michelsen wrote:
> 3) add the slope to the attribute table of the stream/road vector

Frank Broniewski wrote:
....

Why don't you just calculate a slope map for your required region and
use d.profile to see your slope values as a profile. Or you could

use

v.report to see whats under your stream or road.

that gives me an idea, using v.out.ascii + r.profile:

#spearfish dataset
VMAP=railroads
QMAP=slope
OUT=rr_slope_points

v.out.ascii "$VMAP" format=standard | grep '^ [0-9]' | \
   grep -v ^' 1 ' | awk '{print $1 "," $2}' | \
   r.profile -g -c in="$QMAP" --quiet 2> /dev/null | \
   grep -v ' \* ' | cut -f1,2,4,5 -d' ' | \
   v.in.ascii x=1 y=2 out="$OUT" fs=space \
     columns='x double, y double, slope double, GRASSRGB varchar(11)'

d.vect -a "$OUT" size=0 width=2

(line vertices only; bug: includes profiles between line jumps...)

Hamish

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ