| 1 |
## DESCRIPTION |
| 2 |
|
| 3 |
*r.surf.idw* fills a grid cell (raster) matrix with interpolated values |
| 4 |
generated from input raster data points. It uses a numerical |
| 5 |
approximation technique based on distance squared weighting of the |
| 6 |
values of nearest data points. The number of nearest data points used to |
| 7 |
determined the interpolated value of a cell can be specified by the user |
| 8 |
(default: 12 nearest data points). |
| 9 |
|
| 10 |
If there is a current working mask, it applies to the output raster map. |
| 11 |
Only those cells falling within the mask will be assigned interpolated |
| 12 |
values. The search procedure for the selection of nearest neighboring |
| 13 |
points will consider all input data, without regard to the mask. The |
| 14 |
**-e** flag is the error analysis option that interpolates values only |
| 15 |
for those cells of the input raster map which have non-zero values and |
| 16 |
outputs the difference (see [NOTES](#surface-generation-error-analysis) below). |
| 17 |
|
| 18 |
The **npoints** parameter defines the number of nearest data points used |
| 19 |
to determine the interpolated value of an output raster cell. |
| 20 |
|
| 21 |
## NOTES |
| 22 |
|
| 23 |
*r.surf.idw* is a surface generation utility which uses inverse distance |
| 24 |
squared weighting (as described in *Applied Geostatistics* by E. H. |
| 25 |
Isaaks and R. M. Srivastava, Oxford University Press, 1989) to assign |
| 26 |
interpolated values. The implementation includes a customized data |
| 27 |
structure somewhat akin to a sparse matrix which enhances the efficiency |
| 28 |
with which nearest data points are selected. For latitude/longitude |
| 29 |
projections, distances are calculated from point to point along a |
| 30 |
geodesic. |
| 31 |
|
| 32 |
Unlike |
| 33 |
*[r.surf.idw2](https://grass.osgeo.org/grass8/manuals/addons/r.surf.idw2.html)* |
| 34 |
(addon), which processes all input data points in each interpolation |
| 35 |
cycle, *r.surf.idw* attempts to minimize the number of input data for |
| 36 |
which distances must be calculated. Execution speed is therefore a |
| 37 |
function of the search effort, and does not increase appreciably with |
| 38 |
the number of input data points. |
| 39 |
|
| 40 |
*r.surf.idw* will generally outperform *r.surf.idw2* except when the |
| 41 |
input data layer contains few non-zero data, i.e. when the cost of the |
| 42 |
search exceeds the cost of the additional distance calculations |
| 43 |
performed by *r.surf.idw2*. The relative performance of these utilities |
| 44 |
will depend on the comparative speed of boolean, integer and floating |
| 45 |
point operations on a particular platform. |
| 46 |
|
| 47 |
Worst case search performance by *r.surf.idw* occurs when the |
| 48 |
interpolated cell is located outside of the region in which input data |
| 49 |
are distributed. It therefore behooves the user to employ a mask when |
| 50 |
geographic region boundaries include large areas outside the general |
| 51 |
extent of the input data. |
| 52 |
|
| 53 |
The degree of smoothing produced by the interpolation will increase |
| 54 |
relative to the number of nearest data points considered. The utility |
| 55 |
may be used with regularly or irregularly spaced input data. However, |
| 56 |
the output result for the former may include unacceptable |
| 57 |
nonconformities in the surface pattern. |
| 58 |
|
| 59 |
### Surface-generation error analysis |
| 60 |
|
| 61 |
The **-e** flag option provides a standard surface-generation error |
| 62 |
analysis facility. It produces an output raster map of the difference of |
| 63 |
interpolated values minus input values for those cells whose input data |
| 64 |
are non-zero. For each interpolation cycle, the known value of the cell |
| 65 |
under consideration is ignored, and the remaining input values are used |
| 66 |
to interpolate a result. The output raster map may be compared to the |
| 67 |
input raster map to analyze the distribution of interpolation error. |
| 68 |
This procedure may be helpful in choosing the number of nearest |
| 69 |
neighbors considered for surface generation. |
| 70 |
|
| 71 |
## KNOWN ISSUES |
| 72 |
|
| 73 |
Module *r.surf.idw* works only for integer (CELL) raster maps. |
| 74 |
|
| 75 |
## SEE ALSO |
| 76 |
|
| 77 |
*[r.surf.contour](r.surf.contour.md), [r.surf.gauss](r.surf.gauss.md), |
| 78 |
[r.surf.fractal](r.surf.fractal.md), [r.surf.random](r.surf.random.md), |
| 79 |
[v.surf.idw](v.surf.idw.md), [v.surf.rst](v.surf.rst.md)* |
| 80 |
|
| 81 |
Overview: [Interpolation and |
| 82 |
Resampling](https://grasswiki.osgeo.org/wiki/Interpolation) in GRASS |
| 83 |
|
| 84 |
## AUTHOR |
| 85 |
|
| 86 |
Greg Koerper |
| 87 |
Global Climate Research Project |
| 88 |
U.S. EPA Environmental Research Laboratory |
| 89 |
200 S.W. 35th Street, JSB |
| 90 |
Corvallis, OR 97333 |