I have a DEM in GeoTiff format. The processing have made areas that have really low values that I would like to remove.
Are there any GDAL tools that could set all values below -30 to NODATA or -30.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI have a DEM in GeoTiff format. The processing have made areas that have really low values that I would like to remove.
Are there any GDAL tools that could set all values below -30 to NODATA or -30.
Sure you can use the No Data value in gdal_translate
-a_nodata value:
Assign a specified nodata value to output bands. Starting with GDAL 1.8.0, can be set to none to avoid setting a nodata value to the output file if one exists for the source file.
or in gdal_cac.py use the less than (<) or greater than (>) or equals (=) commands.
For example, below will convert the values below 3 to 0 and above 3 to 1. You can use equals as well.
gdal_calc.py -A C:temp\raster.tif --outfile=result.tiff --calc="0*(A<3)" --calc="1*(A>3)"
so as written by Michael yours would be along the lines of
gdal_calc.py -A input.tif --outfile=result.tif --calc="A*(A>-30)" --NoDataValue=-30
Or a combination of above.