File: calc.sh

package info (click to toggle)
rasterio 1.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,744 kB
  • sloc: python: 22,881; sh: 795; makefile: 275; xml: 29
file content (21 lines) | stat: -rwxr-xr-x 742 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

echo "1. gdal_calc.py mult: 0.95 * a"
echo "------------------------------"
time gdal_calc.py --calc "0.95*A" -A tests/data/RGB.byte.tif --allBands A --overwrite --outfile out_gdal.tif
echo ""

echo "2. rio calc mult: 0.95 * a"
echo "--------------------------"
time rio calc "(* (read 1) 0.95)" tests/data/RGB.byte.tif out_rio.tif
echo ""

echo "3. gdal_calc.py mult add: 0.95 * a + 10"
echo "---------------------------------------"
time gdal_calc.py --calc "0.95*A + 10" -A tests/data/RGB.byte.tif --allBands A --overwrite --outfile out_gdal.tif
echo ""

echo "4. rio calc mult add: 0.95 * a + 10"
echo "-----------------------------------"
time rio calc "(+ (* (read 1) 0.95) 10)" tests/data/RGB.byte.tif out_rio.tif
echo ""