1GDAL_CALC(1)                         GDAL                         GDAL_CALC(1)
2
3
4

NAME

6       gdal_calc - Command line raster calculator with numpy syntax.
7

SYNOPSIS

9          gdal_calc.py --calc=expression --outfile=out_filename [-A filename]
10                       [--A_band=n] [-B...-Z filename] [other_options]
11
12       DESCRIPTION
13
14       Command  line raster calculator with numpy syntax. Use any basic arith‐
15       metic supported by numpy arrays such as +, -, *, and \ along with logi‐
16       cal  operators such as >. Note that all files must have the same dimen‐
17       sions, but no projection checking is performed.
18
19       --help Show this help message and exit
20
21       -h     The same as --help.
22
23       --calc=expression
24              Calculation in gdalnumeric syntax using +, -, /, *, or any numpy
25              array functions (i.e. log10()).
26
27       -A <filename>
28              Input gdal raster file, you can use any letter (A-Z).
29
30       --A_band=<n>
31              Number of raster band for file A (default 1).
32
33       --outfile=<filename>
34              Output file to generate or fill.
35
36       --NoDataValue=<value>
37              Output nodata value (default datatype specific value).
38
39       --type=<datatype>
40              Output  datatype, must be one of [Int32, Int16, Float64, UInt16,
41              Byte, UInt32, Float32].
42
43       --format=<gdal_format>
44              GDAL format for output file.
45
46       --creation-option=<option>
47              Passes a creation option to the output format driver.   Multiple
48              options  may  be  listed.  See format specific documentation for
49              legal creation options for each format.
50
51       --co=<option>
52              The same as creation-option.
53
54       --allBands=[A-Z]
55              Process all bands of given raster (A-Z).
56
57       --overwrite
58              Overwrite output file if it already exists.
59
60       --debug
61              Print debugging information.
62
63       --quiet
64              Suppress progress messages.
65

EXAMPLE

67       Add two files together:
68
69          gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"
70
71       Average of two layers:
72
73          gdal_calc.py -A input.tif -B input2.tif --outfile=result.tif --calc="(A+B)/2"
74
75       Set values of zero and below to null:
76
77          gdal_calc.py -A input.tif --outfile=result.tif --calc="A*(A>0)" --NoDataValue=0
78

AUTHOR

80       Chris Yesson <chris dot yesson at ioz dot ac dot uk>, Etienne  Tourigny
81       <etourigny dot dev at gmail dot com>
82
84       1998-2021
85
86
87
88
89                                 Jan 05, 2021                     GDAL_CALC(1)
Impressum