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
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: -s in=elev.drain out=drainline feature=line

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

#Visualization in shaded DEM:
r.colors elev.fillB rast=elevation.dem
d.his h=elev.fillB
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
d.rast -o costpath

Cost surfaces: Considering slope and distance:

r.slope.aspect elev.fillB
r.cost -k coord=602277,4925199
r.mapcals "*"
d.rast elev.costs.sl2
r.drain in=elev.costs.sl2 coord=602277,4925199,603707,4925240
d.his h=elev.fillB
d.rast -o
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
Back Course HOME
Last change: $Date: 2003-11-09 23:08:46 +0100 (Sun, 09 Nov 2003) $