
348
|
Chapter 6, Mapping on Your Desktop
#72 Add Relief to Your Topographic Maps
HACK
out=${dem%.dem}
gdal_translate $dem $out.tiff
r.in.gdal -o in=$out.tiff out=${out}_dem
rm $out.tiff
done
This makes importing the DEMs a piece of cake:
GRASS:~/shade > chmod +x import_dem.sh
GRASS:~/shade > ./import_dem.sh *.dem
The script will take a few moments to run, and then we will have a whole
new set of raster layers in our GRASS mapset:
GRASS:~/shade > g.list type=rast
----------------------------------------------
raster files available in mapset sderle:
hunters_pt_dem pt_bonita_dem sf_south_dem sf_topo
oakland_west_dem sf_north_dem sf_south_oe_dem
----------------------------------------------
Next, we need to stitch these DEM layers together into a single unified layer,
so that we can do shading with it. The r.patch tool does this job admirably.
Note that GRASS only does raster processing within the current region, so
the resulting layer, which we’ll call
sf_elevation, will be clipped to the box
we drew around San Francisco earlier. Make sure you list all the DEM files
on a single line, with no spaces between the commas; GRASS commands are
sensitive to whitespace. Finally, use r.colors to colorize the elevation file and
then display it on the monitor using d.rast:
GRASS:~/shade > r.patch in=pt_bonita_dem,sf_north_dem,sf_south_dem,sf_south_
oe_dem,hunters_pt_dem,oakland_west_dem out=sf_elevation
r.patch: percent ...