
376
|
Chapter 6, Mapping on Your Desktop
#76 Explore the Effects of Global Warming
HACK
The first thing we notice is that the Netherlands almost disappear com-
pletely! Additionally, major cities like London, Copenhagen, and Venice fare
rather poorly. This visualization practically begs our other question: if the
sea level were to rise by 10 meters, how many people might be displaced? To
address this question, we’ll have to redo our analysis to specifically identify
which cells in our DEM raster will be submerged.
Method 2: Applying Raster Algebra
Our second approach will use raster algebra to identify which parts of our
elevation model lie below 10 meters, and hence are at risk of being sub-
merged. Raster algebra is simply any process that derives each cell of a new
output layer by applying a user-specified equation to each corresponding
cell in a set of input layers. The r.mapcalc tool performs this function in
GRASS:
GRASS 5.7.0:~/climate > r.mapcalc 'submerged = if(dem <= 10, 1, null( ))'
100%
GRASS 5.7.0:~/climate > r.colors submerged color=rules
Enter rules, "end" when done, "help" if you need it.
Data range is 1 to 1
> 1 blue
> end
Color table for [submerged] set to rules
Our call to r.mapcalc creates a new layer called submerged, which contains a
value of
1 everywhere dem contains a value less than or equal to 10, and a
null value everywhere else. This gives us a raster layer that consists solely ...