Chapter 6 Data Processing Part-1: Processing Elevation Data
We will process the elevation data as mentioned in the following steps:
- Create watershed basins and river network for the region.
- Select an outlet point and create a watershed for that outlet point.
- The newly created watershed area will be our new region for susceptibility analysis.
- Create terrain variables for the region.
6.1 Hydrological analysis
Elevation data is enough to create watershed boundaries and river network. In this tutorial, we will not talk about theory behind it but just create them.
6.2 Create basins and stream networks
Following steps explain how to create watershed boundaries in Grass.
- Click Menu Raster -> Hydrologic Modeling -> Watershed Analysis as shown in the next figure. Alternatively you can write a command r.watershed in the console and press enter key.
- In the next dialog, select Inputs tab and set dem_rect as elevation data. Keep other fields empty.
- In the Outputs tab enter only the required output maps as shown in the figure.
- Alternatively, you can write the following code in the console and press enter to run.
r.watershed elevation=dem_rect@PERMANENT threshold=15000 accumulation=floacc drainage=flodir basin=basin stream=stream
Figure 6.1: Create Watersheds
Figure 6.2: Create Watersheds
Value of threshold decides the minimum size of basins to be created. Now we can create the stream raster and vector using the following code.
r.stream.extract elevation=dem_rect@PERMANENT accumulation=floacc@PERMANENT threshold=5000 stream_raster=stream_2 stream_vector=river direction=flodir --overwrite
To check the meaning of each input and output, write r.stream.extract in the console and press enter. Corresponding dialog has a tab named Manual which explains the working of the tool and the meaning of parameters in detail.
We can show or hide a layer in the map using Layer Manager interface. The image of elevation with stream looks as in the following figure.
Figure 6.3: Image of Stream Network
We can draw a tentative boundary of Roshi river watershed by visual inspection. Let us select a point near the center of the image to reduce the size of study area. Zoom the map around the center of the area.
6.3 Create new region (Using an outlet point)
- Click Query Raster/Vector map(s) tool in the Map window.
- Click a junction of river.
- A dialog box will show the coordinates of clicked coordinates. Copy the coordinates with a right-click. In the next step we will create the watershed boundary at the selected outlet point.
Figure 6.4: Select the Outlet Coordinates
Write the following code and run in the console.
r.water.outlet input=flodir@PERMANENT output=ws_new coordinates=361590.58053870144, 3044833.5258070175
Above code uses flow direction map as input and outputs new watershed as raster. The coordinates of output are copied from the last step. The raster output ws_new is our new region. To set a new region, we need to:
- Convert the output to vector map using
r.to.vect input=ws_new@PERMANENT output=basin type=area - Crop the region to the extent of basin.
Figure 6.5: Convert Watershed Raster to Vector Polygon
Enter following codes and run each in sequence.
r.mask vector=basinr.mapcalc “dem_clip = dem_rect”(Note: there should be space before and after = in the second code)
First code will create a mask which will be used to set region for the subsequent calculation. Second code will create a copy of the original DEM (elevation map), however only to the extent of mask.
Figure 6.6: Clip the Elevation Data to Watershed Boundary
6.4 Create slope, aspect, plan and profile curvature
There are various ways to run various tools in Grass GIS. To create slope, aspect maps, we can do either of the following two methods:
- At the bottom of layer manager select console tab and write r.slope.aspect and Enter key. You may have to press Enter key two times. Or
- Click Menu Raster -> Terrain Analysis -> Slope and aspect as shown in the next figure.
Figure 6.7: Create Terrain Variables
We can create various terrain variables using this tool. We need to enter the input elevation map and output terrain variables.
- In the screen, select Required tab and select input as dem_clip from the drop down menu.
- Write the names of output map by selecting Outputs tab as shown in the next figure.
- Click Run button at the bottom of interface.
Alternatively, you can directly run following code from console:
r.slope.aspect elevation=dem_clip@PERMANENT slope=slope aspect=aspect pcurvature=profcurv tcurvature=tancurv
Figure 6.8: Create Slope Aspect from Console
6.5 River distance Map
Distance to river can be output as raster map using following code.
r.grow.distance input=stream_2 distance=riverdist
It will create a raster, each cell of which represents the distance from nearest stream.
Figure 6.9: River Distance Raster