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