.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "GDAL-RASTER-FILL-NODATA" "1" "May 06, 2025" "" "GDAL" .SH NAME gdal-raster-fill-nodata \- Fill nodata values in a raster dataset .sp Added in version 3.11. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX Usage: gdal raster fill\-nodata [OPTIONS] Fill nodata raster regions by interpolation from edges. Positional arguments: \-i, \-\-input Input raster dataset [required] \-o, \-\-output Output raster dataset (created by algorithm) [required] Common Options: \-h, \-\-help Display help message and exit \-\-json\-usage Display usage as JSON document and exit \-\-config = Configuration option [may be repeated] \-\-progress Display progress bar Options: \-f, \-\-of, \-\-format, \-\-output\-format Output format \-\-co, \-\-creation\-option = Creation option [may be repeated] \-\-overwrite Whether overwriting existing output is allowed \-b, \-\-band Input band (1\-based index) (default: 1) \-d, \-\-max\-distance The maximum distance (in pixels) that the algorithm will search out for values to interpolate. (default: 100) \-s, \-\-smoothing\-iterations The number of 3x3 average filter smoothing iterations to run after the interpolation to dampen artifacts. The default is zero smoothing iterations. (default: 0) \-\-mask Use the first band of the specified file as a validity mask (zero is invalid, non\-zero is valid). \-\-strategy By default, pixels are interpolated using an inverse distance weighting (invdist). It is also possible to choose a nearest neighbour (nearest) strategy.. STRATEGY=invdist|nearest (default: invdist) Advanced Options: \-\-if, \-\-input\-format Input formats [may be repeated] .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp \fBgdal raster fill\-nodata\fP fills nodata areas by interpolating from valid pixels around the edges of the area. .sp The following options are available: .INDENT 0.0 .TP .B \-f, \-\-of, \-\-format, \-\-output\-format Which output raster format to use. Allowed values may be given by \fBgdal \-\-formats | grep raster | grep + | sort\fP .UNINDENT .INDENT 0.0 .TP .B \-\-output\-layer Output layer name. .UNINDENT .INDENT 0.0 .TP .B \-\-overwrite Allow program to overwrite existing target file or dataset. Otherwise, by default, \fBgdal\fP errors out if the target file or dataset already exists. .UNINDENT .INDENT 0.0 .TP .B \-b Select an input to be processed. Bands are numbered from 1. Default is the first band of the input dataset. .UNINDENT .INDENT 0.0 .TP .B \-max\-distance Specifies the maximum distance (in pixels) that the algorithm will search out for values to interpolate. Default is 100 pixels. .UNINDENT .INDENT 0.0 .TP .B \-\-smoothing\-iterations Specifies the number of smoothing iterations to apply to the filled raster. This can help to reduce artifacts in the filled areas. Default is 0 iterations. .UNINDENT .INDENT 0.0 .TP .B \-\-strategy Select the interpolation to use. By default, pixels are interpolated using an inverse distance weighting (\fIinvdist\fP). It is also possible to choose a nearest neighbour (\fInearest\fP) strategy. .UNINDENT .INDENT 0.0 .TP .B \-\-mask Use the first band of the specified file as a validity mask (zero is invalid, non\-zero is valid). .UNINDENT .SH EXAMPLES .SS Example 1: Fill nodata areas in a raster .sp The command specifies to use the second band of the input raster, 50 px max distance, 3 smoothing iterations and the \fInearest\fP strategy for interpolation. The output will be saved in \fIoutput.tif\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .EX gdal raster fill\-nodata \-b 2 \-\-max\-distance 50 \-\-smoothing\-iterations 3 \e \-\-strategy nearest \-\-mask mask.tif \e input.tif output.tif .EE .UNINDENT .UNINDENT .SH AUTHOR Alessandro Pasotti .SH COPYRIGHT 1998-2025 .\" Generated by docutils manpage writer. .