A.1 Introduction
Most of the work described has relied upon the functionality of the GIS GRASS (Geographical Resources Analysis Support System). GRASS is divided into independent command line modules each associated with a particular GIS operation. Modules are divided into 8 categories, each indicated by its prefix.
d prefix
eg. d.rast
Commands that relate to graphical display such as displaying rasters, vectors, histograms, clearing screen etc.
g prefix
eg. g.list
General file manipulation routines such as the removing of files, renaming files, listing files etc.
i prefix
eg. i.cluster
Image processing functionality such as image classification, rectification, principal components analysis etc.
m prefix
eg. m.tape.examine
Manipulation of input files such as reading tape header files, extraction of remotely sensed images from tape etc.
p prefix
eg. p.map
Paint commands that control output to hardcopy devices.
r prefix
eg. r.buffer
Raster based processing - the largest part of GRASS. Processing includes calculation of cost surfaces, map algebra, buffering etc.
s prefix
eg. s.in.ascii
Sites or point file manipulation including the interpolation of points values, linking point values to a database etc.
v prefix
eg v.to.rast
Vector related functionality, mostly input/output conversion. Includes conversion of Arc/Info files, topology building, digitizing etc.
In many cases existing GRASS functionality has been used in this work, particularly the display related modules and the map algebra module r.mapcalc. However, since many new methods of analysis have been developed for this work, it has been necessary to develop additional modules that can be integrated with existing GRASS functionality. All these additional modules have been written in UNIX C for Irix operating system and take advantage of the GRASS programming libraries (Shapiro et al, 1993). The code for these modules is included in these appendices to provide detailed reference to algorithms and methods described. Modules have been grouped into 4 categories depending on their functionality.
1. Data creation modules
r.frac.surf Creates fractal surface(s) as a GRASS raster using spectral synthesis.
r.gauss.surf Creates a normally distributed (Gaussian) random surface with given mean and standard deviation.
r.xy Creates two rasters containing x and y coordinates of cell location (used for creating polynomial surfaces with r.mapcalc).
2. File conversion utilities
iff2sites Reads and converts LaserScan IFF point files into GRASS sites files.
m.in.dti Reads and converts LaserScan raster DTI files into GRASS rasters.
m.in.ntf Reads and converts Ordnance Survey NTF files into GRASS vector and raster files.
r.to.sites Converts non-zero values in a raster into GRASS sites point files.
3. DEM analysis modules
d.param.scale Allows interactive scale based interrogation of DEM parameters.
r.basin Tessellates a DEM into drainage basins. Can also enforce hydrological connectivity.
r.param.scale Calculates morphometric parameters or features at any scale from a DEM.
v.surf.spline Interpolates contours to give a DEM and calculates RMSE for every cell.
4. Output statistics modules
r.lags Calculates autocorrelation and texture analysis statistics at a variety of scales and produces a 'lag-diagram' of the results.
r.comatrix Calculates and displays the co-occurrence matrix and associated measures from any raster map layer.
r.statistics Calculates and reports simple univariate statistics of any raster map layer.
A.2 Data Creation Modules
r.frac.surf
GRASS module to create a fractal surface of a given fractal dimension. Uses spectral synthesis to generate surface. Can generate multiple realisations at different spectral frequencies.
Jo Wood, 19th October, 1994
r.gauss.surf
GRASS module to produce a raster map layer of gaussian deviates whose mean and standard deviation can be expressed by the user. It is essentialy the same as r.rand.surf, but uses a gaussian random number generator instead. Both random number generators are taken from Press, Flannery, Teukolsky and Vetterling (1988) - Numerical Recipes in C.
Jo Wood, 24th October, 1991
r.xy
GRASS module to produce two raster maps for use with r.mapcalc. One file contains the x-coordinates of each raster map cell, the other, the y-coordinates. These two cells can be used to produce mathematical functions in the form:
z = fn(x,y)
NOTE: x and y values are in RELATIVE coordinates to an origin of (0,0) at the bottom left corner. To transfrom back to georeferenced coordinates use r.mapcalc to add the relative offset to the origin.
Jo Wood, Department of Geography, 28th October 1991
A.3 File Conversion Modules
iff2sites
Program to convert LaserScan IFF point files into ASCII (x,y,z) format for input into GRASS as 'sites' files..
Jo Wood, Department of Geography, 29th July, 1993.
m.in.dti
GRASS module that converts a LaserScan DTI DEM into a GRASS raster.
Jo Wood, Department of Geography, 3rd August 1993
m.in.ntf
GRASS module that converts Ordnace Survey NTF files into GRASS format.
Each line in an NTF file starts with a 2 digit record type. Included here is a list of supported and unsupported record types.
--------------------------------------------
The following NTF record types are supported
00 Continuation record
01 Volume header record
02 Database header record
03 Data description record
04 Data format record
05 Feature classification record
07 Section header record
11 Name record
12 Name position record
14 Attribute record
15 Point record
16 Node record
21 Geometry record
22 3D Geometry record
23 Line record
40 Attribute description record
43 Text record
44 Text position record
45 Text representation record
50 Grid header record
51 Grid data record
99 Volume termination record
-------------------------------------------------
The following are not yet supported
24 Chain record
31 Polygon record
33 Complex polygon
34 Collection of features
-------------------------------------------------
Coding history:
V1.0 Jo Wood, Department of Geography, August 1992
V2.0 Jo Wood, Department of Geography, 29th May 1993,
Reads both NTF 1.0 and NTF 2.0.
V2.1 Modified to read in large scale vector data. Minor bug fixes.
V2.2 Modified, 10th February, 1995. Minor bug fixes.
V2.3 Modified 18th October, 1995. Incorporates 'STRATEGI' vector files;
Minor bug modifications, 19th October, 1995.
Last modified 24th October, 1995 - Fixed attribute labelling problem.
r.to.sites
GRASS module that converts the non-zero values of a raster file into a GRASS sites (point vector) file.
Jo Wood, Department of Geography, 2nd August 1993
A.4 DEM Analysis Modules
d.param.scale
GRASS module that allows interactive indentification of terrain parameters and features with a mouse. Reports membership classes for variable window sizes and their variance or entropy. Based on a modified version of r.param.scale.
Jo Wood, 4th October, 1995
r.basin
Calculates drainage basins by recursive backtracking. Allows slope tolerance values to be specified to alter scale of sub-division. Can also produce 'hydrologically enforced' DEMs by flooding internal pits.
V1.2 Jo Wood, 13th September, 1994
r.param.scale
GRASS module that extracts terrain parameters from a DEM. Uses a multi-scalar approach by taking fitting quadratic parameters to any size window (via least squares).
Jo Wood, 27th November, 1994.
Modified to include constrained fitting, April, 1995
Modified to include weighting matrix and double precision arithmetic, 9th May, 1995.
Modified 23rd May to inclue two separate tolerance values for feature detection.
v.surf.spline
GRASS module to interpolate vector contour data by fitting a cubic spline function to profiles in four directions. It has two advantages over other interpolation techniques: (1) The RMS Error can be calculated for EACH CELL in the DEM as well as an overall RMSE. Spatial variation in error can examined; (2) A cubic spline has the property of 2nd derivative being continuous therefore having implications for slope measurements. Terracing effects should be minimised.
Jo Wood, 29th November 1991
Modified 23rd July 1995 to conform to standard GRASS module layout (main.c, interface.c, process.c etc.)
Modified July, 1995 to incorporate 'addnode' spline constraint.
A.5 Output Statistics Modules
r.comatrix
GRASS module to display a co-occurrence matrix and calculate simple texture measures.
r.lags
GRASS function to calculate various spatial dependence measures for all possible lags within a given image. Each measure is made by comparing two cells only for each lag azimuth and distance. The whole image is read once for each cell in the image, therefore is very computationally expensive. A Sparc 2 would typically take 1 hour to calculate a 150x150 image.
V1.0 written 17.6.92 to calculate Moran autocorrelation statistic.
V2.0 written 18.7.92 to also calulate Haralick's grey-tone spatial
dependence textural measures.
V2.1 modified 18.9.95 to conform to standard GRASS program structure.
r.statistics
Program to calculate simple univariate statistics from a raster layer.
Jo Wood, 26th March, 1995.
Modified, 6th July, 1995 to include skewness and kurtosis.
Modified, 9th July, 1995 to allow exclusion of zero values.