1

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?

1

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.

  • Your command will not generally work for DTED. Read the documents 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. The command must include exactly correct -outsizeand -projwin parameters. And if source data are not in WGS84 you must use gdalwarp with -te and -ts parameters instead. – user30184 Oct 24 '18 at 9:59
  • I have tried gdal_translate -of USGSDEM -a_srs WGS84 input.asc output.dem and I got an output with no errors and was able to open it on Qgis – ArmenB Oct 25 '18 at 19:02
  • update, 1 week after this I discovered that the outputted DEM file is incorrect. – ArmenB Oct 30 '18 at 20:19
  • @ArmenB in general this answer is correct, but like I said you need to check the format pages. Your question only asks about the documentation and I have provided that. – user2856 Oct 30 '18 at 20:32
  • @Luke you are correct – ArmenB Oct 30 '18 at 21:17

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.