Given a topographic GIS raster of one country crop.tif
:
Given a know pixel value such as elevation (z) is +73 :
$ gdallocationinfo crop.tif 1 1 -valonly
> 73
Given an elevation threshold n = 50 (meters)
How to set the value of all/this pixels where z >= n to 50 ?
The solution should be with gdal or in console.
Related to : Gdal: How to get a pixel's value from raster image?, gdal_polygonize.py.
EDIT: I eventually used the formula --calc="50*(A>50)" --NoDataValue=0
standing for "new calc where value set as 50 when value in input A > 50, else value set as 0"
gdal_calc.py -A input.tif --outfile=result.tif --calc="50*(A>50)" --NoDataValue=0