I have DEM data stored as RGF93 (Lambert-93) for lat/lon and NGF-IGN69 for altitude. I'm trying to change the reference ellipsoid for the elevation data (ultimately to NTF, but WGS84 would be fine to understand). I achieved to reproject the file using QGis or GDAL, but I can't find a way to change the altitude values. Shouldn't gdalwarp do the trick ?

Here's an example of a command I used :

-s_srs "+proj=lcc +towgs84=0.0000,0.0000,0.0000 +a=6378137.0000 +rf=298.2572221010000 +lat_0=46.500000000 +lon_0=3.000000000 +lat_1=44.000000000 +lat_2=49.000000000 +x_0=700000.000 +y_0=6600000.000 +units=m +no_defs"
-t_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 +unit=m"
input.tif output

What did I miss ?


No, GDAL doesn't change the values of a dataset when it warps (except to interpolate them of course), it merely stretches the 2D bounds; this is because it can't know that the data you're feeding it is height data, it could equally be rainfall, temperature, or the likelihood of finding the Higgs Boson at that point.

If your area is fairly small, you could find the vertical shift between the two ellipsoids at a point within the bounds of your dataset using gdaltransform, and then add that on to the data with QGIS's raster calculator. Not elegant, I admit, but it'd get you close. You could go one step further and programmatically generate a raster of the vertical shifts covering the same area and at the same resolution, then use the raster calculator to add the two together.

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.