| 1 |
<h2>DESCRIPTION</h2> |
| 2 |
|
| 3 |
<em>r.resamp.interp</em> resamples an input raster map by interpolating between |
| 4 |
the neighboring cells via a selectable resampling algorithm. All cells |
| 5 |
present in the neighborhood of the input raster cell must be non-null to |
| 6 |
generate a non-null cell in the output raster map. A choice of four |
| 7 |
interpolation methods is available; each uses the weighted values of a different |
| 8 |
number of adjacent cells in the input map to determine the value of each |
| 9 |
cell in the output map as follows: |
| 10 |
<ul> |
| 11 |
<li>nearest neighbour (1 cell)</li> |
| 12 |
<li>bilinear (4 cells)</li> |
| 13 |
<li>bicubic (16 cells)</li> |
| 14 |
<li>lanczos (25 cells)</li> |
| 15 |
</ul> |
| 16 |
|
| 17 |
<p>This module is intended for reinterpolation of continuous data |
| 18 |
to a different resolution rather than for interpolation from scattered data |
| 19 |
(use the <em>v.surf.*</em> modules for that purpose). |
| 20 |
|
| 21 |
|
| 22 |
<h2>NOTES</h2> |
| 23 |
|
| 24 |
<p>Resampling modules (<em>r.resample, r.resamp.stats, r.resamp.interp, |
| 25 |
r.resamp.rst</em>) resample the map to match the current region settings. |
| 26 |
|
| 27 |
|
| 28 |
<p>Note that for bilinear, bicubic and lanczos interpolation, |
| 29 |
cells of the output raster that cannot be bounded by the appropriate number |
| 30 |
of input cell centers are set to NULL (NULL propagation). This could occur |
| 31 |
due to the input cells being outside the current region, being NULL or masked. |
| 32 |
|
| 33 |
|
| 34 |
<p>For longitude-latitude coordinate reference systems, |
| 35 |
the interpolation algorithm is based on |
| 36 |
degree fractions, not on the absolute distances between cell centers. Any |
| 37 |
attempt to implement the latter would violate the integrity of the |
| 38 |
interpolation method. |
| 39 |
|
| 40 |
<h3>PERFORMANCE</h3> |
| 41 |
<p>By specifying the number of parallel processes with <b>nprocs</b> option, |
| 42 |
<em>r.resamp.interp</em> can run significantly faster, see benchmarks below. |
| 43 |
|
| 44 |
<div align="center" style="margin: 10px"> |
| 45 |
<img src="r_resamp_interp_benchmark_size.png" alt="benchmark for number of cells" border="0"> |
| 46 |
<br> |
| 47 |
<i>Figure: Benchmark shows execution time for different |
| 48 |
number of cells. See benchmark scripts in source code.</i> |
| 49 |
</div> |
| 50 |
<p>To reduce the memory requirements to minimum, set option <b>memory</b> to zero. |
| 51 |
To take advantage of the parallelization, GRASS |
| 52 |
needs to compiled with OpenMP enabled. |
| 53 |
|
| 54 |
<h2>EXAMPLE</h2> |
| 55 |
|
| 56 |
Resample elevation raster map to a higher resolution (from 500m to 250m; |
| 57 |
North Carolina sample dataset): |
| 58 |
|
| 59 |
<div class="code"><pre> |
| 60 |
g.region raster=elev_state_500m -p |
| 61 |
g.region res=250 -ap |
| 62 |
r.resamp.interp input=elev_state_500m output=elev_state_250m \ |
| 63 |
method=bilinear |
| 64 |
</pre></div> |
| 65 |
|
| 66 |
<center> |
| 67 |
<img src="r_resamp_interp_orig_500m.png" alt="Original 500m resolution elevation map"><br> |
| 68 |
Original 500m resolution elevation map |
| 69 |
<p> |
| 70 |
<img src="r_resamp_interp_new_250m.png" alt="Resampled 250m resolution elevation map"><br> |
| 71 |
Resampled (bilinear) 250m resolution elevation map |
| 72 |
</center> |
| 73 |
|
| 74 |
<h2>SEE ALSO</h2> |
| 75 |
|
| 76 |
<em> |
| 77 |
<a href="g.region.html">g.region</a>, |
| 78 |
<a href="r.resample.html">r.resample</a>, |
| 79 |
<a href="r.resamp.filter.html">r.resamp.filter</a>, |
| 80 |
<a href="r.resamp.rst.html">r.resamp.rst</a>, |
| 81 |
<a href="r.resamp.stats.html">r.resamp.stats</a> |
| 82 |
</em> |
| 83 |
|
| 84 |
<p> |
| 85 |
Overview: <a href="https://grasswiki.osgeo.org/wiki/Interpolation">Interpolation and Resampling</a> in GRASS |
| 86 |
|
| 87 |
<h2>AUTHOR</h2> |
| 88 |
|
| 89 |
Glynn Clements |