I have a geotiff that I converted to a ENVI raster file with the following command:
gdal_translate -of ENVI srtm_05_08.tif data.bil
The geotiff has water values supposedly set to nodata. I am doing an interpolation on the data.bil file, and when I do, the water shows up at a height of about 32000m. I am wondering if there is a simple way to change the nodata to be 0. I tried:
gdal_translate -of ENVI srtm_05_08.tif data.bil -a_nodata none
and
gdal_translate -of ENVI srtm_05_08.tif data.bil -a_nodata 0.0
but neither of those seemed to work.
Is there an easy way to switch the data values? I could do something like:
if (val>5000) then val=0
but I am very much a beginner and don't know how to do it.
Best Answer
NODATA is a tag, not a value.
If you only need to attach NODATA to a different value you can try:
You strip away NODATA tag (always helpful) with:
Finally, if you need to actualy change the value and reattach NODATA to it, you might try something like this:
You can modify --calc part to suit your needs, it supports many things.