r.fillnulls.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <h2>DESCRIPTION</h2>
  2. <em>r.fillnulls</em> fills NULL pixels (no data areas) in input raster
  3. map and stores filled data to a new output raster map. The fill areas
  4. are interpolated from the no data area boundaries buffer
  5. using <em><a href="v.surf.rst.html">v.surf.rst</a></em> regularized
  6. spline interpolation with tension (<b>method=rst</b>) or
  7. <em><a href="r.resamp.bspline.html">r.resamp.bspline</a></em> cubic or
  8. linear spline interpolation with Tykhonov regularization.
  9. <h2>NOTES</h2>
  10. Each area boundary buffer is set to three times the map resolution to get nominally
  11. three points around the edge. This way the algorithm interpolates into the hole with
  12. a trained slope and curvature at the edges, in order to avoid that such a flat plane
  13. is generated in a hole. The width of edge area can be adjusted by
  14. changing the edge parameter.
  15. <p>During the interpolation following warning may occur when using the RST method:<p>
  16. <tt>
  17. Warning: strip exists with insufficient data<br>
  18. Warning: taking too long to find points for interpolation--please change
  19. the region to area where your points are</tt>
  20. <p>
  21. This warning is generated if large data holes exist within the surface.
  22. As the idea of <em>r.fillnulls</em> is to fill such holes, the user may
  23. ignore the warning. The interpolation will be continued. However, the user
  24. may pay attention to below notes.
  25. <p>
  26. If interpolation fails, temporary raster and vector maps are left in place to allow
  27. unfilled map hole (NULL area) identification and manual repair.
  28. <p>
  29. When using the default RST method, the algorithm is based
  30. on <em><a href="v.surf.rst.html">v.surf.rst</a></em> regularized
  31. splines with tension interpolation module which interpolates the
  32. raster cell values for NULL data areas from the boundary values of the
  33. NULL data area. An eventual raster MASK is respected during the NULL
  34. data area(s) filling. The interpolated values are patched into the
  35. NULL data area(s) of the input map and saved into a new raster map.
  36. Otherwise, either the linear or cubic spline interpolation with
  37. Tykhonov regularization can be selected (based on
  38. <em><a href="r.resamp.bspline.html">r.resamp.bspline</a></em>).
  39. <h2>WARNING</h2>
  40. Depending on the shape of the NULL data area(s) problems may occur due to an
  41. insufficient number of input cell values for the interpolation process. Most
  42. problems will occur if a NULL data area reaches a large amount of the map
  43. boundary. The user will have to carefully check the result using
  44. <em><a href="r.mapcalc.html">r.mapcalc</a></em> (generating a
  45. difference map to the input map and applying the
  46. &quot;differences&quot; color table
  47. with <em><a href="r.colors.html">r.colors</a></em>) and/or to query
  48. individual cell values.
  49. <p>
  50. RST method stores temporary maps on hard disk. It will require at least as much
  51. free space as one extra input raster map takes.
  52. <h2>EXAMPLE</h2>
  53. In this example, the SRTM elevation map in the
  54. North Carolina sample dataset location is filtered for outlier
  55. elevation values; missing pixels are then re-interpolated to obtain
  56. a complete elevation map:
  57. <div class="code"><pre>
  58. g.region raster=elev_srtm_30m -p
  59. d.mon wx0
  60. d.histogram elev_srtm_30m
  61. # remove too low elevations (esp. lakes)
  62. r.mapcalc "elev_srtm_30m_filt = if(elev_srtm_30m &lt; 50.0, null(), elev_srtm_30m)"
  63. d.histogram elev_srtm_30m_filt
  64. d.rast elev_srtm_30m_filt
  65. r.fillnulls input=elev_srtm_30m_filt output=elev_srtm_30m_complete tension=20
  66. d.histogram elev_srtm_30m_complete
  67. d.rast elev_srtm_30m_complete
  68. </pre></div>
  69. <h2>REFERENCES</h2>
  70. <ul>
  71. <li> Mitas, L., Mitasova, H., 1999, Spatial Interpolation. In: P.Longley,
  72. M.F. Goodchild, D.J. Maguire, D.W.Rhind (Eds.), Geographical Information
  73. Systems: Principles, Techniques, Management and Applications, Wiley,
  74. pp.481-492
  75. <li>Mitasova H., Mitas L.,&nbsp; Brown W.M.,&nbsp; D.P. Gerdes, I.
  76. Kosinovsky, Baker, T.1995, Modeling spatially and temporally distributed
  77. phenomena: New methods and tools for GRASS GIS. <i>International Journal of
  78. GIS</i>, 9 (4), special issue on Integrating GIS and Environmental modeling,
  79. 433-446.
  80. <li><a href="http://www4.ncsu.edu/~hmitaso/gmslab/papers/lmg.rev1.ps">Mitasova H.
  81. and Mitas L. 1993</a>: Interpolation by Regularized Spline with Tension: I.
  82. Theory and Implementation, <i>Mathematical Geology</i> 25, 641-655.
  83. <li><a href="http://www4.ncsu.edu/~hmitaso/gmslab/papers/hmg.rev1.ps">Mitasova H.
  84. and Hofierka L. 1993</a>: Interpolation by Regularized Spline with Tension:
  85. II. Application to Terrain Modeling and Surface Geometry Analysis,
  86. <i>Mathematical Geology</i> 25, 657-667.
  87. </ul>
  88. <h2>SEE ALSO</h2>
  89. <em>
  90. <a href="r.fill.dir.html">r.fill.dir</a>,
  91. <a href="r.mapcalc.html">r.mapcalc</a>,
  92. <a href="r.resamp.bspline.html">r.resamp.bspline</a>,
  93. <a href="v.surf.rst.html">v.surf.rst</a>
  94. </em>
  95. <h2>AUTHORS</h2>
  96. Markus Neteler, University of Hannover and Fondazione Edmund Mach<br>
  97. Improvement by Hamish Bowman, NZ
  98. <p>
  99. <i>Last changed: $Date$</i>