Workshops
CSIRO intro | copyright | queries | user guide | publications | bug info | data
program code | feedback | search | tour | around the world | workshops
CRCCH


TUTORIAL
Exercise 1 | Exercise 2 | Exercise 3 | Exercise 4 | Exercise 5


Online Tutorial
Exercise 1, Digital Elevation Modelling

In this session, we introduce you to the following programs:
  • _demgen - graphical interface used to run programs _splin2h and _grdcon
  • _splin2h - generates a regular grid of elevations from irregular points or contours
  • _grdcon - fits contours to the regular grid of data produced by _splin2h
  • _display - graphical interface used to display spatial data of any kind

We work with four catchments:

  • yahoo - gently undulating, 265 ha catchment near Mudgee, NSW.
  • bullshead - steep, 84 ha catchment in the Brindabella Ranges near Canberra.
  • caspar - steep, 516 ha catchment in northern California
  • oleo - steep, x ha catchment in Fiji.


1.1 Download the file called topog.tutorial_files.tar.gz from this web site. This contains all of the files you will need to complete the tutorial. . Download these in a different directory from the one you are working in so that you don't overwrite them.

1.2 Using the editor, view the contents of file yahoo.xyz; these are spot heights for the yahoo catchment.

1.3 Run _demgen, using basename yahoo. Press the Display button and select the spot heights (.xyz file) to the screen. Note how the elevations are colour-coded.

1.4 Now, let's build a parameter file to run splin2h. Using this program, we will eventually create a regular grid of elevations from an irregular array of elevations.

Perform the following tasks:

  • select the Build .spl file option.
  • press the HELP button to get the ? symbol.
  • point this at any data entry field to get a help message.
  • change the following entries to:

    RMS error		0.1
    xmin and xmax		9395.0	11605.0
    ymin and ymax		17115.0	20390.0
    zmin and zmax		90.0	153.0
    grid spacing		5.0

  • press the Save button to save these entries.
  • bring up the File Descriptions dialog box by pressing the Input Files button.
  • enter yahoo.xyz in the Selection field.
  • specify filetype: 1, no header, data format: (3f10.3).
  • press the Apply button.
  • press the Close button to exit from the File Descriptions dialog box.
  • press the Save button in the Build a .spl file dialog box to save all entries.
  • exit from this dialog box by pressing Quit.

1.5 Run splin2h; this fits a regular grid of elevation data around the .xyz file that we supplied to the program.

Perform the following tasks:

  • bring the terminal window to the front of the screen to watch progress.
  • when done, pop the terminal window back to the rear of the screen.
  • open a new window to view the contents of the file yahoo.grd.
  • note that the first line indicates the number of rows and columns in the grid and the coordinates of the origin.
  • close yahoo.grd and open yahoo.sys; this contains information on data ranges and provides a scale factor for later graphics programs.
  • return to the _demgen window.
  • display the fitted grid (.grd file) on the screen.

1.6 Using the editor, view the contents of the file yahoo.spl; this is the input parameter file for _splin2h you created using _demgen. In future, you could edit this file manually, by ensure that you understand what each data item represents.

1.7 Now, let's build a parameter file to run grdcon. Perform the following tasks:
  • select the Build .gcn file option; this is the input parameter file needed by grdcon.
  • change the following entries to:

    Contour interval			1.0
    Minimum contour length (points)		10

  • press the Save button to save all entries, and press Quit.
  • select the Run grdcon option; this fits contours to the data grid that was generated using splin2h.
  • bring the terminal window to the front of the screen to observe progress.
  • pop it back when done.

1.8 Let's examine some of the display functions in _demgen.

Perform the following tasks:

  • clear the screen by pressing the Clear button.
  • display the contour file produced by grdcon (.tcn file).
  • press the Zoom/Pan button and practise the zoom , pan and unzoom functions.
  • press the left mouse button once, move the mouse (note a dashed box grow as you move the mouse), then press the left button once more; this zooms in on the selected box.
  • press the middle button to pan the zoomed box through space.
  • press the right mouse button to unzoom.

1.9 Let's look at some files using the editor.

Perform the following tasks:

  • open file yahoo.gcn; this is the input parameter file for _grdcon you created using _demgen. It's kind of like the .spl file used in _splin2h; you can edit this manually in the future, permitted you understand what you are doing!
  • open file yahoo.bound; we refer to this as a 'polygon file'. This file will be used to define the domain of computation for _grdcon.

1.10 Now, return to _demgen.

Perform the following tasks:

  • rebuild the .spl file, adding yahoo.bound to the input files list.
  • press the Help button to obtain the appropriate filetype number, and header and data block formats for a polygon file.
  • rerun splin2h; data points lying outside the polygon defined by yahoo.bound will be clipped out.
  • display the new fitted grid (.grd file).
  • rebuild the .gcn file, specifiying irregular contour intervals.
  • use the following values:

     Special value option 		Clipped   
     Contour type			Discrete

  • use 1 m contours between 93 and 119 m, and 2 m contours between 119 and 153 m.
  • enter your selections in the Selection field (eg: 93. 119. 1.), pressing Add after each entry.
  • scroll through the list of contours to make sure you have entered your values properly.
  • when done, press the Save button.
  • press the Quit button.
  • rerun grdcon with the new .gcn file.
  • clear the information from the screen.
  • display the new .tcn file again and note the changes.

1.11 Now, let's turn to the bullshead catchment. With the yahoo catchment, we started with xyz data points. With the bullshead catchment we are starting with contour data.

Perform the following tasks:

  • view the contents of file bullshead.cns; we refer to this as a 'raw contours' file.
  • run _demgen, using basename bullshead.
  • display the raw contours (.cns file) to the screen.
  • note how the contours are discontinuous in certain areas; they may also have an irregular contour intervals.

1.12 Now, let's build a parameter file to run splin2h.

Perform the following tasks:

  • build an .spl file.
  • change the following entries to:

        Elevation data		Mainly contours
        RMS error		0.5
        Derivative tradeoff	0.0
        Sink tolerances		2.5	5.0	12.0  
        xmin and xmax		1455.0	2925.0
        ymin and ymax		2115.0	3640.0
        zmin and zmax		1150.0	1365.0
        grid spacing		5.0

  • use file bullshead.bound as a polygon file to clip values outside the raw data range.
  • run splin2h.
  • display the .grd file.

1.13 Now, let's build a parameter file to run grdcon.

Perform the following tasks:

  • build the .gcn file.
  • change the following entries to:

       Special value option		Clipped
       Contour interval		5.0
       Minimum contour length (points)		30   

  • run grdcon.
  • display the .tcn file.
  • note how the gaps have been filled in.

1.14 Let's familiarise ourselves with a new graphical display program that has some of the display functions of _demgen, but more.

Perform the following tasks:

  • run _display using basename yahoo.
  • display yahoo.tcn using the Contours button (select 'DEM Contours').
  • zoom in on a sub-area using the Zoom button.
  • return to full display using the Zoom Out button.
  • change the colour of the contours using the Colour button.
  • determine the cursor location using the Cursor button.
  • determine contour point coordinates using the Search button.
  • overlay a grid using the Grid button.
  • display the elevation data points (under Points).
  • search on the elevation data points.
  • clear the elevation data points, using the CLEAR button.
  • display file peizo.pts, using the Other button (select 'Specify>')
  • change style to large dots using Colour/Style button (toggle to change mode)
  • press the Annotate button, enter a string of words, press < return >, then point to a spot to the right of the plot.
  • change the font size for the annotation.
  • press the Dump button; this captures the screen image and writes it to a POSTSCRIPT file.

1.15 Now we learn how to use the screen digitising facility in _display.

Perform the following tasks:

  • press the Digitise button once; note that this changes to New Poly and that the following message appears in the control window:

     Polygon File
     yahoo.data.a				
      
     Poly# 1

  • draw a square in the plot window by clicking the mouse at five points.
  • press New Poly; note that the button title changes to Save.
  • press Save to save the digitised data; this is written to a file called yahoo.dat.a.
  • press the Digitise button again; note that the control panel now reads:

     Polygon File
     yahoo.data.b				
      
     Poly# 1

  • digitise another square in another location.
  • press New Poly once only; note that the control panel now reads:

     Polygon File
     yahoo.data.b				
      
     Poly# 2

  • digitise a third square.
  • finally, press New Poly, followed by Save; this time, two polygons are written to file yahoo.dat.b.

1.16 Let's examine our results from the screen digitising exercise.

Perform the following tasks:

  • clear all data from the screen.
  • re-plot the two files you have created (under Polygons).
  • change the colour and line thickness of the polygons, differentiating them.
  • quit _display.

1.17 Examine the contents of files yahoo.dat.a and yahoo.dat.b, using the editor. Delete both files after you have viewed them.

1.18 You have now learnt pretty much all you need to generate a DEM using _demgen. It's time to test your skills on caspar. This time we start the exercise with xyz data again, though in reality, the points were sourced from a contour data set in someones GIS.

Perform the following tasks:

  • open file caspar.xyz; note the data format.
  • run _demgen.
  • load file caspar.xyz.
  • build an .spl file; raw data is poor quality contours with a 12 m height interval.
  • run _splin2h.
  • plot the .grd file.
  • build a .gcn file; use a 3 m contour interval.
  • run _grdcon.
  • plot the .tcn file.
  • repeat the above exercise using caspar.bound as a polygonal boundary file.

1.19 This is the final DEM exercise; here we go to a sub-basin of the oleo catchment. Our starting point is raw contour data.

Perform the following tasks:

  • run _demgen, using basename oleo.
  • load file oleo.cns.
  • build an .spl file; raw data is poor quality contours with a 5 m height interval.
  • use oleo.bound as a polygonal boundary file.
  • plot the .grd file.
  • build a .gcn file; use a 2 m contour interval, starting at an elevation of 126 m.
  • between 126 and 130 m, set the contour interval to 1 m.
  • run _grdcon.
  • plot the .tcn file.
  • quit _demgen.


TUTORIAL
Exercise 1 | Exercise 2 | Exercise 3 | Exercise 4 | Exercise 5

Menubar

last modified on 5 September 1997