FREC 682 Spatial Analysis

course syllabus


Report Generation Modules

d.histogram displays a histogram (pie or bar chart) of relative frequencies of cell categories in a raster layer, using the category colors from the raster map's color table. When doing a histogram of a greyscale map, d.erase blue or some other background color so you can see all greyscale values.

r.info prints descriptive information about a specified raster layer from its hist file as created by r.support. This is where you store meta-data about your raster maps: data sources, accuracy, etc.

r.describe lists category values or value ranges in a raster layer. There are two output formats: one value per line (suitable for redirecting to a file) or terse ranges of values. The module can read the full range of values in a raster map from its range file (located in a subdirectory of the cell_misc directory in your mapset), or report values subject the the current region or mask.

r.cats lists the raster values and associated category labels in a map. This output can also be redirected to a text file using any desired field-delimiter character. The output can be limited to sub-ranges of values if desired.

r.stats lists categories or category combinations and (with the -a flag) calculates the area of each category in one or multiple raster layers. For example,
r.stats -a input=geology,vegcover fs=space output=geol.veg.stats
creates an ASCII text file in which each line reports a soil-vegcover category combination and total square meters in that combination.

r.coin produces cross-tabulations from two raster layers in table form, including row and column sums, in various units of area measure. For example,
r.coin map1=geology map2=vegcover units=acres > geol.veg.tab
will output a table showing total acreage in each geology-vegcover combination.

r.report creates nicely formatted area measure reports from one or more raster layers. You can suck the output directly into a word-processor. Or you can re-format it with AWK to create a reclass rules file (you can sort clump maps generated from r.clump this way), or a cats file.

r.covar creates an N x N covariance (or correlation with -r flag) matrix for any N specified raster layers.

r.cross outputs a new raster layer which is a cross-product of categories from 2 to 10 input raster layers. You could then run r.report on this to calculate areas in each category combination.

r.profile outputs raw, median or average raster values lying along a user-defined line of specified width (default 1 cell),
e.g., r.profile map=elevation.dem line=593655,4917280,594726,4918351

r.transect is almost identical to r.profile, but the user specifies starting-point, azimuth (0 to 360 clockwise from north) and distance as line= parameters.

r.volume computes the volume of data clumps. It can output a sites file of clump centroids labeled with clump volumes. Or its output can be reformatted as a reclass rules file or cats file. For example, you could extract high-elevation igneous cells from geology:
r.mapcalc hi_ign='if(geology==3) && if(elevation.dem>1400)'
This will yield a binary map. Run r.clump on this map to assign each clump of cells a unique ID. then run r.volume on elevation.dem for the extracted clumps of cells to determine total igneous overlay above 1400 meters in each clump.



course syllabus