Geography Reference
In-Depth Information
The r.mapcalc creates a new raster map named los_river_nulls using the
output from the r.los command. The if statement says, “If a cell has a
value of 0, set it to null; otherwise, set it to its current value.” This gives
us a raster with all the values outside our analysis area set to null,
and we can now see the results with our background layers showing
through. In Figure 10.1 , on the following page, you can see the results
of the analysis, with those areas that we can see from our position (the
red circle) shown in light blue. We've overlaid the LOS results on our
DRG so we can compare the analysis with the topography. As you might
expect, our line of sight is somewhat limited when standing in the river
bottom. We can't see very far to the west, basically just along the top of
the river bluff. We can see upstream and downstream a fair bit, as well
as to the east, which is on the inside of the river bend and consequently
doesn't have a high bank.
If we didn't want to create a new layer, it turns out there is an easier
way for us to set those pesky 0s to null:
r.null map=los_river setnull=0
That's it— r.null does the trick. Now the LOS result map has nulls prop-
erly set and can be displayed directly. So, why did we go to all the
trouble to use r.mapcalc ? It's mainly to introduce the concept of map
algebra, which we'll look at in a bit more depth later.
To test the LOS ability of GRASS, we took a simple example from the
river bottom. We hope that was enough for you to see the power of this
type of analysis. We also used a bit of map algebra to tweak the output
and make it more appealing when displayed with the background lay-
ers. We'll continue our river theme in the next section by looking at the
watershed modeling tools in GRASS.
10.3
Hydrologic Modeling
GRASS includes a number of modules for hydrologic modeling, includ-
ing modules to create and analyze watershed basins, carve out streams
in a DEM, trace a drainage path, simulate flooding, and perform a host
of other functions. These modules provide a sophisticated toolset for
your hydrologic modeling needs.
To illustrate one of these tools, we'll take a simple example and raise the
sea level by 100 meters using the Ancc6_dem DEM. The r.lake module
allows you to create a new raster map portraying the filling of an area
 
 
 
Search WWH ::




Custom Search