I am trying to use the SRTM .hgt file to obtain the height of a location. My issue is that I wish to reproject the SRTM file from WGS84 to Mercator but the height returned is not consistent after reprojection of the height file. From QGIS I selected a point where I believed that will cause such an issue.

QGIS Point Selection
The band value is different due to the fact that the coordinate reference system in QGIS can only read either WGS84 or Mercator at any point of time. This image is to ensure the conversion of WGS84 coordinate to Mercator coordinate is correct when i am trying to retrieve the band value(height).

Program Input
This image displays the issue I have been facing for quite sometime, as we can see that the coordinate have been converted to Mercator correctly, but the band value (height) returned is different from the WGS84, Mercator and Mercator with bilinear resampling.

What is the reason to cause the issue of different height value on different projection?

Command Used in Conversion:
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 N45E005.hgt MN45E005.tif
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 –r bilinear N45E005.hgt MBN45E005.tif

Downloadable Files to replicate test:
SRTM3 Files with created outputs


If you convert from one CRS to another, you will change the cell borders automatically.

gdalwarp tries to keep the cell value, but it will also try to interpolate if the new cell size will cover different unreprojected cells.

Reducing the cell size with -tr or -ts might solve your problem (but increase the raster file size too).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.