[GIS] Convert pixel values of a raster from meters to feet and from feet to meters – GDAL

gdalgdal-translategdalwarp

I want to convert the elevation of a GeoTIFF from meter to the feet, so I can create a contour in feet. I've used gdal_translate:

gdal_translate -scale 0 0.3048 0 1 inputmeters.tif outputfeet.tif

but when I create a contour, both are identical. and with the gdal_info I don't see any changes in the metadata.
I'm not sure if the gdal_translate is the command that I need!

It is necessary for me somehow to check if the outputfeet.tif unit type is feet.

Best Answer

Try with gdal_calc:

gdal_calc -A inputmeters.tif --outfile=outputfeet.tif --calc="A/0.3048"

I think could be more precise for your purposes. But, CRS is in feet or meters? Maybe a two-step process with gdalwarp and gdal_calc

Related Question