GDAL – How to Convert GeoTIFF to USGS DEM or DTED

demdtedgdalgdal-translategeotiff-tiff

I have been looking the documentation for gdal_translate and it doesn't list the -of format available options there. So I tried looking at the source and basically ended up read the SetFromUserInput function source looks for several strings none of which has any reference to dem or dted. For reference here is the link:

https://github.com/OSGeo/gdal/blob/501ca3703ff4d33badbc539ab7121f6263ff1ac3/gdal/ogr/ogrspatialreference.cpp

I see alot of examples like so:

gdal_translate -of KMLSUPEROVERLAY mosaic.vrt out.kmz

but can't find any info on the type of output formats. is there a proper documentation for this?

Best Answer

The GDAL Raster Formats list show USGSDEM and DTED as supporting "Copy" which means you can output a copy of an existing raster to those formats.

So try:

gdal_translate -of USGSDEM inputfilename outputfilename

and

gdal_translate -of DTED inputfilename outputfilename

Don't forget to check the format pages to see if there are any -co creation options you can/should specify. In particular, note for DTED:

Creation Issues

The DTED driver does support creating new files, but the input data must be exactly formatted as a Level 0, 1 or 2 cell. That is the size, and bounds must be appropriate for a cell.