1

I have 10 geotiffs Modis ndvi named 2005.tif ... 2014.tif I want to stack them all and create timeseries. i know how to do that, but the stacked images still need scaling by 0.0001. how can i bulk scale them using gdal -scale function before stacking them?


Tried the first line on OSGeo, but when openning the new tifs all I can see is 0s and 1s. any idea?

0

1 Answer 1

5

In Windows (run OSGeo4W shell):

Scaling:

for %i in (*.tif) DO gdal_translate -scale -2000 10000 -0.2 1 %i outputs\%i

You might find recalculating instead better:

for %i in (*.tif) DO gdal_calc.bat -A %i --outfile=outputs\%i --calc="A*0.0001" --NoDataValue=0

In Ubuntu looping through files is slightly different:

for i in *.tif; do
    gdal_calc -A $i ...
done
2
  • Tried the -scale -2000 10000 -0.2 1 but it gave me a tif with only 0 and 1 as output, nothing in between. Commented Nov 3, 2015 at 2:01
  • try setting -ot Float32 Commented Nov 3, 2015 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.