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 *)
CPLErr GDALGridDataMetricMinimum (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)
CPLErr GDALGridDataMetricMaximum (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)
CPLErr GDALGridDataMetricRange (const void *, GUInt32, const double *, const double *, const double *, double, double, double *)

Detailed Description

GDAL gridder related entry points and definitions.


Function Documentation

CPLErr GDALGridDataMetricMaximum ( const void *  poOptions,
GUInt32  nPoints,
const double *  padfX,
const double *  padfY,
const double *  padfZ,
double  dfXPoint,
double  dfYPoint,
double *  pdfValue 
)

Maximum data value (data metric).

Maximum value found in grid node search ellipse. If there are no points found, the specified NODATA value will be returned.

\[ Z=\max{(Z_1,Z_2,\ldots,Z_n)} \]

where

  • $Z$ is a resulting value at the grid node,
  • $Z_i$ is a known value at point $i$,
  • $n$ is a number of points in search ellipse.
Parameters:
poOptions Algorithm parameters. This should point to GDALGridDataMetricsOptions object.
nPoints Number of elements in input arrays.
padfX Input array of X coordinates.
padfY Input array of Y coordinates.
padfZ 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 GDALGridDataMetricMinimum ( const void *  poOptions,
GUInt32  nPoints,
const double *  padfX,
const double *  padfY,
const double *  padfZ,
double  dfXPoint,
double  dfYPoint,
double *  pdfValue 
)

Minimum data value (data metric).

Minimum value found in grid node search ellipse. If there are no points found, the specified NODATA value will be returned.

\[ Z=\min{(Z_1,Z_2,\ldots,Z_n)} \]

where

  • $Z$ is a resulting value at the grid node,
  • $Z_i$ is a known value at point $i$,
  • $n$ is a number of points in search ellipse.
Parameters:
poOptions Algorithm parameters. This should point to GDALGridDataMetricsOptions object.
nPoints Number of elements in input arrays.
padfX Input array of X coordinates.
padfY Input array of Y coordinates.
padfZ 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 GDALGridDataMetricRange ( const void *  poOptions,
GUInt32  nPoints,
const double *  padfX,
const double *  padfY,
const double *  padfZ,
double  dfXPoint,
double  dfYPoint,
double *  pdfValue 
)

Data range (data metric).

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.

\[ Z=\max{(Z_1,Z_2,\ldots,Z_n)}-\min{(Z_1,Z_2,\ldots,Z_n)} \]

where

  • $Z$ is a resulting value at the grid node,
  • $Z_i$ is a known value at point $i$,
  • $n$ is a number of points in search ellipse.
Parameters:
poOptions Algorithm parameters. This should point to GDALGridDataMetricsOptions object.
nPoints Number of elements in input arrays.
padfX Input array of X coordinates.
padfY Input array of Y coordinates.
padfZ 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 GDALGridInverseDistanceToAPower ( const void *  poOptions,
GUInt32  nPoints,
const double *  padfX,
const double *  padfY,
const double *  padfZ,
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 $Z$ will be calculated using formula:

\[ Z=\frac{\sum_{i=1}^n{\frac{Z_i}{r_i^p}}}{\sum_{i=1}^n{\frac{1}{r_i^p}}} \]

where

  • $Z_i$ is a known value at point $i$,
  • $r$ is a distance from the grid node to point $i$,
  • $p$ is a weighting power,
  • $n$ is a number of points in search ellipse.

In this method the weighting factor $w$ is

\[ w=\frac{1}{r^p} \]

Parameters:
poOptions Algorithm parameters. This should point to GDALGridInverseDistanceToAPowerOptions object.
nPoints Number of elements in input arrays.
padfX Input array of X coordinates.
padfY Input array of Y coordinates.
padfZ 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 *  padfX,
const double *  padfY,
const double *  padfZ,
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 *  padfX,
const double *  padfY,
const double *  padfZ,
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.

Mathematically it can be expressed with the formula:

\[ Z=\frac{\sum_{i=1}^n{Z_i}}{n} \]

where

  • $Z$ is a resulting value at the grid node,
  • $Z_i$ is a known value at point $i$,
  • $n$ is a number of points in search ellipse.
Parameters:
poOptions Algorithm parameters. This should point to GDALGridMovingAverageOptions object.
nPoints Number of elements in input arrays.
padfX Input array of X coordinates.
padfY Input array of Y coordinates.
padfZ 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 *  padfX,
const double *  padfY,
const double *  padfZ,
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.
padfX Input array of X coordinates.
padfY Input array of Y coordinates.
padfZ 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 doxygen 1.6.2-20100208.