I have 2 DTM datasets, the first has a vertical datum of WGS84
, while the second has an orthometric vertical datum (maybe EGM96). gdalinfo
seems to only provide the horizontal datum info:
Size is 5551, 3250
Coordinate System is:
PROJCRS["WGS 84 / UTM zone 16N",
BASEGEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]],
CONVERSION["UTM zone 16N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",-87,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["easting",east,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["northing",north,
ORDER[2],
LENGTHUNIT["metre",1]],
ID["EPSG",32616]]
The output above is the exact same for both datasets.
I want to convert the second dataset's vertical datum to WGS84
using gdalwarp
, but I've tried many variations of the following commands to no avail (egm96_15.gtx
is in /usr/share/proj
):
gdalwarp in_dtm.tif out_wgs84_dtm.tif -s_srs EPSG:4326+5773 -t_srs EPSG:4979
gdalwarp in_dtm.tif out_wgs84_dtm.tif -s_srs "+proj=longlat +datum=WGS84 +no_defs +geoidgrids=/path/to/egm96_15.gtx" -t_srs "+proj=longlat +datum=WGS84 +no_def"
I've also tried converting the WGS84 DTM to EGM96, but no matter what I try, the output file's elevations aren't any different from the input file. Multiple people have asked how to do this before, but none of the answers to other posts are working for me.
Why won't it work?
Possible issues:
- I'm using a DTM and not a DEM
- Versions: GDAL=3.3.2, PROJ=7.2
- Both datasets have the same
DATUM
tag, but store data in different reference frames
gdalwarp
command in my post didn't work?EPSG:4326+5773
. I think you are doing the right thing. Perhaps your Proj version cannot handle the conversion.