I want to change one tiff file to USGS DEM file. For that I am doing following steps:

  1. Transform the tiff file to WGS84 coordiantes using Gdal Wrap utility

    gdalwarp -t_srs EPSG:4326 -dstnodata -90909 -of GTiff Source.tif DestWGS84.tif

  2. Then convert the WgS84 tiff file to DEM file using Gdal Translate utility

    gdalTranslate -of USGSDEM DestWGS84.tif Final.dem

When I pass -dstnodata swirch in gdalwarp uitlity the created DEM file have invalid data at the edges. enter image description here

But when I don't pass the no data switch then the minimum elevation is not set (shows zero) and hence other computaion fails. enter image description here

Can we create DEM file without transforming it in WGS84??

1 Answer 1


Provide the source DEM no data value as well in the command line.

Try the following command:

gdalwarp -t_srs EPSG:4326 -srcnodata {source no data value} -dstnodata -90909 -of GTiff Source.tif DestWGS84.tif

This should help in fixing the zero elevation issue you have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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