Aller au contenu principal

GDAL Moving Average Interpolation

Overview

Moving average interpolation is an estimation method based on the arithmetic mean of sample points within a local neighborhood. For each location to be interpolated, the method builds an elliptical or circular search neighborhood and calculates the average attribute value of all known sample points within that neighborhood as the estimated value for the location.

Unlike inverse distance weighting (IDW), moving average interpolation does not apply distance-based weighting. Each sample point in the neighborhood contributes equally to the result. This method creates a very smooth interpolated surface and can effectively suppress local noise in the source data.

How It Works

For any location to be interpolated, x0x_0, the interpolation result Z^(x0)\hat{Z}(x_0) is the arithmetic mean of the attribute values of all sample points in the neighborhood:

Z^(x0)=1ni=1nZ(xi)\hat{Z}(x_0) = \frac{1}{n} \sum_{i=1}^{n} Z(x_i)

Where:

  • Z(xi)Z(x_i): the observed value of the ii-th sample point within the search neighborhood.
  • nn: the total number of valid sample points in the neighborhood.

Use Cases

  • Data smoothing and noise reduction: Removes local value spikes or abnormal peaks caused by measurement errors.
  • Trend analysis: Extracts broad regional trends by using a large moving average radius.
  • Missing value filling: Quickly fills scattered empty cells in areas where data is distributed relatively evenly.

Parameters

ParameterDescriptionNotes
Input vector fileThe vector dataset that contains spatial point features to interpolate.Supports SHP, GeoJSON, and other formats.
Interpolation fieldThe numeric attribute column used for interpolation.Must be numeric.
X-direction search radiusThe semi-axis length of the elliptical search neighborhood in the X direction (radius1).Determines the local window size used for calculation.
Y-direction search radiusThe semi-axis length of the elliptical search neighborhood in the Y direction (radius2).Set this based on anisotropy in the data distribution.
Rotation angle (Angle)The counterclockwise rotation angle of the elliptical search neighborhood relative to the X axis.Used for data fields with directional offsets.
Minimum number of pointsThe minimum number of sample points used in calculation (min_points).If the neighborhood contains too few points, the result is output as NoData.
Output settingsDefines the spatial reference, extent, and cell size of the result raster.See Common raster output.
Output fileSpecifies the storage location and file name of the output raster data.See Common raster output.

Steps

  1. Start the tool: Open Raster Basic Tools > Interpolate to Raster, then double-click Moving Average Interpolation.
  2. Set the input: Select the vector point layer and the interpolation field.
  3. Configure neighborhood parameters: Enter the X/Y-direction search radius. A larger radius creates a smoother surface but may obscure more local features.
  4. Set the minimum point count: Set Minimum number of points to ensure each cell estimate has sufficient statistical support.
  5. Configure output properties: Define the coordinate system, extent, and cell size.
  6. Run the tool: Click Run.

Notes

  • No weighting: Because distance decay is not considered, points at the neighborhood edge have the same influence as points near the center. This may make the interpolated surface overly flat where sample points are sparse.
  • Smoothing versus detail: The search radius is critical. An overly large radius can cause the interpolation result to lose important spatial details, such as terrain ridgelines.
  • Edge effects: At the boundary of the study area, sample points may be distributed asymmetrically within the neighborhood, which can introduce systematic bias in the interpolation result.