- Main Page
- Classes
- Files
- Related Pages

- File List
- File Members

# gdalgrid.h File Reference

`#include "gdal_alg.h"`

Go to the source code of this file.

## Typedefs
typedef CPLErr(*) | GDALGridFunction (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)
## Functions
CPLErr | GDALGridInverseDistanceToAPower (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)
CPLErr | GDALGridInverseDistanceToAPowerNoSearch (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)
CPLErr | GDALGridMovingAverage (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)
CPLErr | GDALGridNearestNeighbor (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)

## Detailed Description

GDAL gridder related entry points and definitions.

## Function Documentation

CPLErr GDALGridInverseDistanceToAPower | ( | const void * | poOptions,
|  | GUInt32 | nPoints,
|  | const double * | pdfX,
|  | const double * | pdfY,
|  | const double * | pdfZ,
|  | double | dfXPoint,
|  | double | dfYPoint,
|  | double * | pdfValue |
| ) |  |  |

Inverse distance to a power.

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

- is a distance from the grid node to point ,
- is a known value at point ,
- is a weighting power.

In this method the weighting factor is

Parameters:

  | poOptions | Algorithm parameters. This should point to GDALGridInverseDistanceToAPowerOptions object.
  | nPoints | Number of elements in input arrays.
  | pdfX | Input array of X coordinates.
  | pdfY | Input array of Y coordinates.
  | pdfZ | Input array of Z values.
  | dfXPoint | X coordinate of the point to compute.
  | dfYPoint | Y coordinate of the point to compute.
  | nXPoint | X position of the point to compute.
  | nYPoint | Y position of the point to compute.
  | pdfValue | Pointer to variable where the computed grid node value will be returned.

Returns:
  CE_None on success or CE_Failure if something goes wrong.

CPLErr GDALGridInverseDistanceToAPowerNoSearch | ( | const void * | poOptions,
|  | GUInt32 | nPoints,
|  | const double * | pdfX,
|  | const double * | pdfY,
|  | const double * | pdfZ,
|  | double | dfXPoint,
|  | double | dfYPoint,
|  | double * | pdfValue |
| ) |  |  |

Inverse distance to a power for whole data set.

This is somewhat optimized version of the Inverse Distance to a Power method. It is used when the search ellips is not set. The algorithm and parameters are the same as in GDALGridInverseDistanceToAPower(), but this implementation works faster, because of no search.

See also:
  GDALGridInverseDistanceToAPower()

CPLErr GDALGridMovingAverage | ( | const void * | poOptions,
|  | GUInt32 | nPoints,
|  | const double * | pdfX,
|  | const double * | pdfY,
|  | const double * | pdfZ,
|  | double | dfXPoint,
|  | double | dfYPoint,
|  | double * | pdfValue |
| ) |  |  |

Moving average.

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.

Parameters:

  | poOptions | Algorithm parameters. This should point to GDALGridMovingAverageOptions object.
  | nPoints | Number of elements in input arrays.
  | pdfX | Input array of X coordinates.
  | pdfY | Input array of Y coordinates.
  | pdfZ | Input array of Z values.
  | dfXPoint | X coordinate of the point to compute.
  | dfYPoint | Y coordinate of the point to compute.
  | pdfValue | Pointer to variable where the computed grid node value will be returned.

Returns:
  CE_None on success or CE_Failure if something goes wrong.

CPLErr GDALGridNearestNeighbor | ( | const void * | poOptions,
|  | GUInt32 | nPoints,
|  | const double * | pdfX,
|  | const double * | pdfY,
|  | const double * | pdfZ,
|  | double | dfXPoint,
|  | double | dfYPoint,
|  | double * | pdfValue |
| ) |  |  |

Nearest neighbor.

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.

Parameters:

  | poOptions | Algorithm parameters. This should point to GDALGridNearestNeighborOptions object.
  | nPoints | Number of elements in input arrays.
  | pdfX | Input array of X coordinates.
  | pdfY | Input array of Y coordinates.
  | pdfZ | Input array of Z values.
  | dfXPoint | X coordinate of the point to compute.
  | dfYPoint | Y coordinate of the point to compute.
  | pdfValue | Pointer to variable where the computed grid node value will be returned.

Returns:
  CE_None on success or CE_Failure if something goes wrong.

Generated for GDAL by 1.5.1.