Spatial Hydrology Seminar

Kwabena Asante

Dept. of Civil Engineering
University of Texas at Austin

This seminar will explore the use of GIS and other tools for performing spatial analysis. As part of this seminar, we will be developing Avenue programs that perform tasks of interest to us. Some of the exercises we have undertaken are detailed below.

*************************

Exercise 1:

This exercise is to serve as an introduction to Avenue programming. I have developed a program that computes distance. The user is prompted to click on two points in a view and the program returns the distance between the two points. The main functions used in this program are GETACTIVEDOC, GETDISPLAY, RETURNUSERPOINT, GETX, GETY and MSGBOX.INFO. To see the script click on getdist.ave, the name of the program.

*************************

Exercise 2:

This is a continuation of the first exercise. The program has now been modified to allow the user to perform multiple computations. The program also creates a table into which the results of computation are stored. The modified script is called getdist2.ave The main functions used in this program are VTAB.MAKENEW, LIST.MAKE, DEEPCLONE, FIELD.MAKE, ADDFIELDS, ADDRECORD, TABLE.SETEDITABLE, WHILE, MSGBOX.YESNO, FINDFIELD and SETVALUE.

*************************

Exercise 3:

The first part of this exercise explores the creation of tables, accessing the records in the table and performing operations on the records. The program creates tables for storing the operation data of three reservoirs and then prompts the user to select the table and the fields to be edited. The user can select any field in the table and change the monthly value of that field. The storage for all the months is then computed and written to the table. The main commands used in this exercise are VTAB.MAKENEW, GETWIN.OPEN, AV.GETPROJECT.ADDDOC, MSGBOX.CHOICEASSTRING, TABLE.GETFIELDS AND TABLE.GETNUMRECORDS. To see the script click on damdata.txt, the name of the program.

The second part of this exercise involved looking up sample scripts, running the scripts and documenting and any new commands. One such sample script searches through a selected file for a specified (old) string, and replaces it (the old string) with a new string. The main commands in this script are the file management commands FILEDIALOG.SHOW, GETBASENAME, GETEXTENSION and RETURNDIR; the process status commands AV.SHOWSTOPBUTTON, AV.SHOWMSG, AV.SETSTATUS and AV.CLEARSTATUS; and the file/string processing commands READELT, WRITEELT, STRING.CONTAINS and STRING.SUBSTITUTE. To see the script click on chngstrg.txt, the name of the program.

*************************

Exercise 4:

This exercise involves the use of Avenue programming to perform operations on a grid. The program interpolates values from a point coverage onto a grid. The themes to be used should be added to the view prior to running the program. The user is prompted for the point theme and the grid theme to be used for the interpolation. The grid theme defines the extent of the interpolation while the point theme contains the quantity to be interpolated and the location at which the measurements were made. The parameters for the interpolation are also a required input. The functions used in this program are FINDTHEME, RETURNEXTENT, GETGRID, INTERPOLATIONDIALOGSHOW AND MAKEBYINTERPOLATION. To see the script click on intepolt.txt, the name of the program.

*************************

Exercise 5: Writing a Tutorial:

This exercise involves writing a tutorial for the user who wants to run the interpolation program developed in exercise 4 above. The text version of this tutorial is currently being documented online. The files are available from the FTP site described in the exercise. Download the files and try out the first part of the exercise. To see the exercise click on Surface Grid Exercise,

*************************

GIS at the AWWA Computer Conference

I attend the AWWA computer conference to see how GIS is being used in the water supply and land development industry. Click here for my a description of some of the interesting stuff I saw.