1r.fillnulls(1)              GRASS GIS 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]    [memory=memory  in  MB]     [--overwrite]    [--help]
18       [--verbose]  [--quiet]  [--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
76       memory=memory in MB
77           Maximum memory to be used (in MB)
78           Cache size for raster rows
79           Default: 300
80

DESCRIPTION

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

NOTES

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

WARNING

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

EXAMPLE

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

REFERENCES

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

SEE ALSO

181        r.fill.dir, r.mapcalc, r.resamp.bspline, v.surf.rst
182

AUTHORS

184       Markus Neteler, University of Hannover  and Fondazione Edmund Mach
185       Improvement by Hamish Bowman, NZ
186

SOURCE CODE

188       Available at: r.fillnulls source code (history)
189
190       Main index | Raster index | Topics index | Keywords index  |  Graphical
191       index | Full index
192
193       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
194
195
196
197GRASS 7.8.5                                                     r.fillnulls(1)
Impressum