GridMath module


version 0.4.0

The gridmath module is an add-on module that contains procedures that operate on raster bands to produce derived products. Many procedures operate on all data types, but several procedures only operate on floating point data or 32-bit integer data. Procedures may add a raster band to the data set containing the source data, but many other procedures will overwrite the source data.

The gridmath module is sub-divided into a number of units that group related algorithms. Right now there are two units available with several procedures that operate on single raster bands.


Identity operations

The TDSpGMIdentity gridmath unit provides three functions that modify raster bands:

Single band operations

The TDSpGMSingleBand gridmath unit provides single band math operations. The source raster band is always overwritten with the result of the calculation. This makes it easy to chain a number of operations without the overhead of creating intermediate raster bands. The following functions are supported:

Windowed filter functions

The TDSpGMFilter gridmath unit provides two public functions where a filter is passed over a raster band. The filter is a square matrix of size 3x3 to 49x49, and each cell of the filter is multiplied by the corresponding pixel of the kernel window around the current pixel, added up and assigned to the current pixel in the resulting band, with normalization to unity of the filter factors being optional. Depending on the data type of the filter, a band of type dspInt32 or dspFloat32 is produced in the raster.

  • Integer filter
  • Floating-point filter
Windowed statistical functions
The TDSpGMStats gridmath unit provides basic windowed statistical functions that operate on a raster band. The statistic is calculated on a window of 3x3 to 49x49 around the current pixel. A new band is always created for the statistic, the data type of which depends on the statistic in question.
  • Mean
  • Variance
  • Standard deviation
  • Median
  • Sum
  • Min
  • Max
  • Range
  • Variety

Go to SourceForge
Last modified: 18 March 2005. Page maintained by pvanlaake