Skip to content

Instantly share code, notes, and snippets.

@franzalex
Last active January 28, 2021 12:03
Show Gist options
  • Save franzalex/6f9477b236a17ef97ca8797d7bb9e5a6 to your computer and use it in GitHub Desktop.
Save franzalex/6f9477b236a17ef97ca8797d7bb9e5a6 to your computer and use it in GitHub Desktop.
How to Calculate IDW

Calculating IDW

For a given number (n) of neighbouring points (p) within a given radius, the IDW value for a point of interest (v) is calculated as follows.

  1. Calculate the Euclidean distance between each of the neighboring points (pi)
    Euclidean Distance Formula

  2. Normalize the Euclidean distances calculated as a ratio relative to the maximum Euclidean distance value (or any other chosen maximum).
    Normalize Distances Formula

  3. Choose a suitable attenuation power to use for weighting Attenuation power formula
    Consult the figure below for a visual representation of the attenuation rate for some selected power values:
    Graph of IDW Weighting Powers

  4. Calculate the weight of each neighboring point (n)
    Point weight formula

  5. Calculate the IDW by performing a weighted average of the neighboring points' values using the points' respective weights.
    Final IDW Formula

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment