1r.fillnulls(1)                Grass User's Manual               r.fillnulls(1)
2
3
4

NAME

6       r.fillnulls  - Fills no-data areas in raster maps using spline interpo‐
7       lation.
8

KEYWORDS

10       raster, surface, elevation, interpolation, splines, no-data filling
11

SYNOPSIS

13       r.fillnulls
14       r.fillnulls --help
15       r.fillnulls  input=name  output=name   method=string    [tension=float]
16       [smooth=float]    [edge=integer]    [npmin=integer]    [segmax=integer]
17       [lambda=float]    [--overwrite]    [--help]    [--verbose]    [--quiet]
18       [--ui]
19
20   Flags:
21       --overwrite
22           Allow output files to overwrite existing files
23
24       --help
25           Print usage summary
26
27       --verbose
28           Verbose module output
29
30       --quiet
31           Quiet module output
32
33       --ui
34           Force launching GUI dialog
35
36   Parameters:
37       input=name [required]
38           Name of input raster map
39
40       output=name [required]
41           Name for output raster map
42
43       method=string [required]
44           Interpolation method to use
45           Options: bilinear, bicubic, rst
46           Default: rst
47
48       tension=float
49           Spline tension parameter
50           Default: 40.
51
52       smooth=float
53           Spline smoothing parameter
54           Default: 0.1
55
56       edge=integer
57           Width of hole edge used for interpolation (in cells)
58           Options: 2-100
59           Default: 3
60
61       npmin=integer
62           Minimum number of points for approximation in a segment (>segmax)
63           Options: 2-10000
64           Default: 600
65
66       segmax=integer
67           Maximum number of points in a segment
68           Options: 2-10000
69           Default: 300
70
71       lambda=float
72           Tykhonov regularization parameter (affects smoothing)
73           Used in bilinear and bicubic spline interpolation
74           Default: 0.01
75

DESCRIPTION

77       r.fillnulls  fills  NULL pixels (no data areas) in input raster map and
78       stores filled data to a new output  raster  map.  The  fill  areas  are
79       interpolated  from  the no data area boundaries buffer using v.surf.rst
80       regularized  spline  interpolation   with   tension   (method=rst)   or
81       r.resamp.bspline  cubic  or  linear  spline interpolation with Tykhonov
82       regularization.
83

NOTES

85       Each area boundary buffer is set to three times the map  resolution  to
86       get  nominally  three  points  around  the edge. This way the algorithm
87       interpolates into the hole with a trained slope and  curvature  at  the
88       edges, in order to avoid that such a flat plane is generated in a hole.
89       The width of edge area can be adjusted by changing the edge parameter.
90
91       During the interpolation following warning may occur when using the RST
92       method:
93
94       Warning: strip exists with insufficient data
95       Warning:  taking  too  long  to  find  points for interpolation--please
96       change the region to area where your points are
97
98       This warning is generated if large data holes exist within the surface.
99       As  the  idea of r.fillnulls is to fill such holes, the user may ignore
100       the warning. The interpolation will be continued. However, the user may
101       pay attention to below notes.
102
103       If  interpolation  fails,  temporary raster and vector maps are left in
104       place to allow unfilled map hole (NULL area) identification and  manual
105       repair.
106
107       When using the default RST method, the algorithm is based on v.surf.rst
108       regularized splines with tension interpolation  module  which  interpo‐
109       lates the raster cell values for NULL data areas from the boundary val‐
110       ues of the NULL data area. An eventual raster MASK is respected  during
111       the NULL data area(s) filling. The interpolated values are patched into
112       the NULL data area(s) of the input map and saved into a new raster map.
113       Otherwise,  either  the  linear  or  cubic  spline  interpolation  with
114       Tykhonov regularization can be selected (based on r.resamp.bspline).
115

WARNING

117       Depending on the shape of the NULL data area(s) problems may occur  due
118       to  an  insufficient  number of input cell values for the interpolation
119       process. Most problems will occur if a NULL data area reaches  a  large
120       amount  of  the map boundary. The user will have to carefully check the
121       result using r.mapcalc (generating a difference map to  the  input  map
122       and  applying  the  "differences"  color table with r.colors) and/or to
123       query individual cell values.
124
125       RST method stores temporary maps on hard disk. It will require at least
126       as much free space as one extra input raster map takes.
127

EXAMPLE

129       In  this  example,  the SRTM elevation map in the North Carolina sample
130       dataset location is filtered for outlier elevation values; missing pix‐
131       els are then re-interpolated to obtain a complete elevation map:
132       g.region raster=elev_srtm_30m -p
133       d.mon wx0
134       d.histogram elev_srtm_30m
135       # remove SRTM outliers, i.e. SRTM below 50m (esp. lakes), leading to no data areas
136       r.mapcalc "elev_srtm_30m_filt = if(elev_srtm_30m < 50.0, null(), elev_srtm_30m)"
137       d.histogram elev_srtm_30m_filt
138       d.rast elev_srtm_30m_filt
139       # using the default RST method to fill these holes in DEM
140       r.fillnulls input=elev_srtm_30m_filt output=elev_srtm_30m_rst tension=20
141       # using the bilinear method to fill these holes in DEM
142       r.fillnulls input=elev_srtm_30m_filt output=elev_srtm_30m_bilin method=bilinear
143       d.histogram elev_srtm_30m_rst
144       d.rast elev_srtm_30m_rst
145       d.erase
146       d.histogram elev_srtm_30m_bilin
147       d.rast elev_srtm_30m_bilin
148       r.mapcalc "diff_rst_bilin = elev_srtm_30m_rst - elev_srtm_30m_bilin"
149       r.colors diff_rst_bilin color=differences
150       r.univar -e diff_rst_bilin
151       d.erase
152       d.rast diff_rst_bilin
153       d.legend diff_rst_bilin
154

REFERENCES

156           ·   Mitas,  L.,  Mitasova,  H.,  1999,  Spatial  Interpolation. In:
157               P.Longley, M.F. Goodchild, D.J. Maguire, D.W.Rhind (Eds.), Geo‐
158               graphical  Information Systems: Principles, Techniques, Manage‐
159               ment and Applications, Wiley, pp.481-492
160
161           ·   Mitasova H., Mitas L.,  Brown W.M.,   D.P.  Gerdes,  I.   Kosi‐
162               novsky,  Baker,  T.1995, Modeling spatially and temporally dis‐
163               tributed phenomena: New methods and tools for GRASS GIS. Inter‐
164               national  Journal  of  GIS, 9 (4), special issue on Integrating
165               GIS and Environmental modeling, 433-446.
166
167           ·   Mitasova H.  and Mitas L. 1993:  Interpolation  by  Regularized
168               Spline  with Tension: I.  Theory and Implementation, Mathemati‐
169               cal Geology 25, 641-655.
170
171           ·   Mitasova H.  and Hofierka L. 1993: Interpolation by Regularized
172               Spline  with  Tension:  II. Application to Terrain Modeling and
173               Surface Geometry Analysis, Mathematical Geology 25, 657-667.
174

SEE ALSO

176        r.fill.dir, r.mapcalc, r.resamp.bspline, v.surf.rst
177

AUTHORS

179       Markus Neteler, University of Hannover  and Fondazione Edmund Mach
180       Improvement by Hamish Bowman, NZ
181
182       Last changed: $Date: 2018-08-27 18:33:07 +0200 (Mon, 27 Aug 2018) $
183

SOURCE CODE

185       Available at: r.fillnulls source code (history)
186
187       Main index | Raster index | Topics index | Keywords index  |  Graphical
188       index | Full index
189
190       © 2003-2019 GRASS Development Team, GRASS GIS 7.4.4 Reference Manual
191
192
193
194GRASS 7.4.4                                                     r.fillnulls(1)
Impressum