GDAL

Gridding is a process of creating a regular grid (or call it a raster image) from the scattered data. Typically you have a set of arbitrary scattered over the region of survey measurements and you would like to convert them into the regular grid for further processing and combining with other grids.
That is what GDAL Grid API is about. It helps you to interpolate your data (see Interpolation of the Scattered Data) or compute data metrics (see Data Metrics Computation).
There are two ways of using this interface. Programmatically it is available through the GDALGridCreate C function; for end users there is a gdal_grid utility. The rest of this document discusses details on algorithms and their parameters implemented in GDAL Grid API.
The Inverse Distance to a Power gridding method is a weighted average interpolator. You should supply the input arrays with the scattered data values including coordinates of every data point and output grid geometry. The function will compute interpolated value for the given position in output grid.
For every grid node the resulting value will be calculated using formula:
where
In this method the weighting factor is
See GDALGridInverseDistanceToAPowerOptions for the list of GDALGridCreate parameters and invdist for the list of gdal_grid options.
The Moving Average is a simple data averaging algorithm. It uses a moving window of elliptic form to search values and averages all data points within the window. Search ellipse can be rotated by specified angle, the center of ellipse located at the grid node. Also the minimum number of data points to average can be set, if there are not enough points in window, the grid node considered empty and will be filled with specified NODATA value.
Mathematically it can be expressed with the formula:
where
See GDALGridMovingAverageOptions for the list of GDALGridCreate parameters and average for the list of gdal_grid options.
The Nearest Neighbor method doesn't perform any interpolation or smoothing, it just takes the value of nearest point found in grid node search ellipse and returns it as a result. If there are no points found, the specified NODATA value will be returned.
See GDALGridNearestNeighborOptions for the list of GDALGridCreate parameters and nearest for the list of gdal_grid options.
All the metrics have the same set controlling options. See the GDALGridDataMetricsOptions.
Minimum value found in grid node search ellipse. If there are no points found, the specified NODATA value will be returned.
where
Maximum value found in grid node search ellipse. If there are no points found, the specified NODATA value will be returned.
where
A difference between the minimum and maximum values found in grid node search ellipse. If there are no points found, the specified NODATA value will be returned.
where
Search window in gridding algorithms specified in the form of rotated ellipse. It is described by the three parameters:
$Id: grid_tutorial.dox 14579 20080530 15:41:30Z dron $