GRASS Short Course - Notes for Part 5: DEM and raster map processing

Examples based on Spearfish location.

Simple flow tracing

Exercise: Following a rain drop in the terrain.
#r.fill.dir: filling sinks (several passes may be required)
r.bilinear in=elevation.dem out=elev.bilin

#run as often (iteratively changing the in/out names) as needed to fill all
#areas:
r.fill.dir in=elev.bilin elev=elev.fillA dir=elev.dirA area=elev.fillerrA
r.fill.dir in=elev.fillA elev=elev.fillB dir=elev.dirB area=elev.fillerrB

#calculate depressions map:
r.mapcalc "depressions=elev.fillB-elevation.dem"

#r.drain: drain a water flow through terrain for given point
r.drain in=elev.fillB out=elev.drain coord=596255,4916606

#Vectorization:
r.to.vect -s in=elev.drain out=drainline feature=line

#Visualization in aspect map:
r.slope.aspect elev.fillB as=elev.fillB.as
d.rast elev.fillB.as
d.vect drainline col=blue

#Visualization in shaded DEM:
r.colors elev.fillB rast=elevation.dem
d.his h=elev.fillB i=elev.fillB.as
d.vect drainline col=blue

Cost surfaces

Cost surfaces: Considering elevation and distance:
r.cost -k in=elev.fillB output=elev.costs coord=602277,4925199
d.rast elev.costs

#visualize with perspective:
nviz elev.costs

#find optimal route from starting to target point:
r.drain in=elev.costs out=costpath coord=602277,4925199,603707,4925240

d.his h=elev.fillB i=elev.fillB.as
d.rast -o costpath

Cost surfaces: Considering slope and distance:

r.slope.aspect elev.fillB as=elev.fillB.sl
r.cost -k in=elev.fillB.sl output=elev.costs.sl coord=602277,4925199
r.mapcals "elev.costs.sl2=elev.costs.sl*elev.costs.sl"
d.rast elev.costs.sl2
r.drain in=elev.costs.sl2 out=costpath.sl coord=602277,4925199,603707,4925240
d.his h=elev.fillB i=elev.fillB.as
d.rast -o costpath.sl
d.rast -o costpath

Exercise II - Fictious project "Methane pipeline planning"

The scope of this project is to plan a methane pipeline from point A to B in the Spearfish area (UTM 13N/NAD27 coordinates):
Start point:   604994,4916724
Arrival point: 594520,4924706

Following conditions/restrictions:

To calculate/produce: GIVEN: Excavation costs for a pipeline segment of 10m, depending on the rock type (US Dollars) - see 'geology' map:
metamorphic 100
transition  120
igneous     1000
sandstone   110
limestone   80
shale       100
sandy shale 120
claysand    100
sand	    140

GIVEN: cubic meter/hectare of vegetation depending on the vegetation type - see 'vegcover' map:

irrigated agriculture 100
rangeland              10
coniferous forest    5000 
deciduous forest     2000                                                   
mixed forest         2500                                                   
disturbed             200                                                  

© 2003 Markus Neteler (neteler AT itc.it)
Back Course HOME
Last change: $Date: 2003-11-09 23:08:46 +0100 (Sun, 09 Nov 2003) $