Given a topographic GIS raster of one country crop.tif
:
# download:
curl -o ETOPO1.zip 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/georeferenced_tiff/ETOPO1_Ice_g_geotiff.zip'
# unzip:
unzip ETOPO1.zip
# crop:
gdal_translate -projwin -005.50 051.30 10.00 041.00 ETOPO1_Ice_g_geotiff.tif crop.tif
Given an elevation threshold n = 50 (meters)
How to set the value of all pixels where z >= n to 50 ?
Related to : https://stackoverflow.com/questions/18300210/, Gdal: How to get a pixel's value from raster image?
Help?: gdallocationinfo can get the value of one point (without iterating the whole image):
$ gdallocationinfo crop.tif 1 1 -valonly
> 73