File: gdal_calc.dox

package info (click to toggle)
gdal 2.1.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 88,596 kB
  • ctags: 83,118
  • sloc: cpp: 905,174; ansic: 184,486; python: 19,037; cs: 13,347; sh: 11,615; perl: 7,012; java: 5,382; php: 3,187; xml: 2,401; yacc: 1,154; makefile: 517; sql: 112
file content (62 lines) | stat: -rw-r--r-- 2,395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

/*! \page gdal_calc gdal_calc.py

Command line raster calculator with numpy syntax

\section gdal_calc_synopsis SYNOPSIS

\verbatim
gdal_calc.py [-A <filename>] [--A_band] [-B...-Z filename] [other_options]

Options:
  -h, --help            show this help message and exit
  --calc=CALC           calculation in gdalnumeric syntax using +-/* or any
                        numpy array functions (i.e. logical_and())
  -A A                  input gdal raster file, note you can use any letter
                        A-Z
  --A_band=A_BAND       number of raster band for file A (default 1)
  --outfile=OUTF        output file to generate or fill
  --NoDataValue=NODATAVALUE
                        set output nodata value (Defaults to datatype specific
                        value)
  --type=TYPE           output datatype, must be one of ['Int32', 'Int16',
                        'Float64', 'UInt16', 'Byte', 'UInt32', 'Float32']
  --format=FORMAT       GDAL format for output file (default 'GTiff')
  --creation-option=CREATION_OPTIONS, --co=CREATION_OPTIONS
                        Passes a creation option to the output format driver.
                        Multiple options may be listed. See format specific
                        documentation for legal creation options for each
                        format.
  --allBands=ALLBANDS   process all bands of given raster (A-Z)
  --overwrite           overwrite output file if it already exists
  --debug               print debugging information
\endverbatim

\section gdal_edit_description DESCRIPTION

Command line raster calculator with numpy syntax. Use any basic arithmetic supported by numpy arrays such as +-*\ along with logical operators such as >.  Note that all files must have the same dimensions, but no projection checking is performed.

\section gdal_edit_example EXAMPLE

add two files together
\verbatim
gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"
\endverbatim

average of two layers
\verbatim
gdal_calc.py -A input.tif -B input2.tif --outfile=result.tif --calc="(A+B)/2"
\endverbatim

set values of zero and below to null
\verbatim
gdal_calc.py -A input.tif --outfile=result.tif --calc="A*(A>0)" --NoDataValue=0
\endverbatim

\if man
\section gdal_edit_author AUTHORS
Chris Yesson <chris dot yesson at ioz dot ac dot uk>
Etienne Tourigny <etourigny dot dev at gmail dot com>
\endif
*/